运行时错误:java.lang.ExceptionInInitializerError

时间:2012-12-09 00:55:34

标签: java html applet runtime-error java-7

我正在尝试将我编写的Java小程序嵌入到html文件中。每次运行该文件时,都会出现“java.lang.ExceptionInInitializerError”。我假设问题出在初始化函数中,所以我将其包含在下面。如果有任何其他有用的信息/代码,请告诉我们!

如何解决java.lang.ExceptionInInitializerError

@Override
public void init(){   
    //Execute a job on the event-dispatching thread; creating this applet's GUI.
    try {  
        SwingUtilities.invokeAndWait(new Runnable() {
            @Override
            public void run() {
                enterLogin();
            }
        });
    } 
    catch (InterruptedException | InvocationTargetException e) {
        System.err.println("createGUI didn't complete successfully");
    }
}

0 个答案:

没有答案