我不知道我的Jframes调用方法是否有问题,或者它是Launch4J配置的问题。
我目前有一个欢迎框架,它提供两个选项,选择一个将打开相应的Jframe并继续该程序。
在Netbeans IDE上进行测试时,程序运行没有问题,并相应地显示了面板。
问题是我用Launch4J打包程序,程序只运行在第一个面板上,每当你选择一个选项时它就会关闭。
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if(opcionMetodo==1){
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows Classic".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FauryJoisel.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(() -> {
new FauryJoisel().setVisible(true);
});
dispose();
// JOptionPane.showMessageDialog(jOptionPane2, "Ingresa y Verifica todos los Campos", "NO OLVIDES", INFORMATION_MESSAGE);
}else if(opcionMetodo==0){
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Windows Classic".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(FauryJoisel.class
.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(() -> {
new Faury().setVisible(true);
});
dispose();
//JOptionPane.showMessageDialog(jOptionPane2, "Ingresa y Verifica todos los Campos", "NO OLVIDES", INFORMATION_MESSAGE);
}
}
这是我在Welcome框架上调用的代码,它来自一个调用所选Jframe的按钮操作。
启动4J错误测试程序时记录
Executing: C:\Users\ssd\Desktop\Dosificador 2015.exe
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/jfree/data/xy/XYDataset
at Frames.Bienvenido.lambda$jButton1ActionPerformed$0(Bienvenido.java:182)
at Frames.Bienvenido$$Lambda$17/1094521478.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.jfree.data.xy.XYDataset
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 16 more
提前致谢