我之前使用此代码启动过此表单,但在对该表单进行多次编辑后,它将不再启动。有什么建议吗?
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info: javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Registrar.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
new Registrar().setVisible(true);
}
});
}
最佳答案
可能的发现..
- 使用调试并找到错误。
- 从项目中检查默认运行>properties>运行并检查默认主类;
- 删除所有代码并重写主类;
建议:应该有错误信息。你应该发布那个。
关于java - 我的 java swing 表单无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16122191/