我正在尝试将我编写的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");
}
}