gpt4 book ai didi

java - 我的 java swing 表单无法启动

转载 作者:行者123 更新时间:2023-11-29 09:03:42 25 4
gpt4 key购买 nike

我之前使用此代码启动过此表单,但在对该表单进行多次编辑后,它将不再启动。有什么建议吗?

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);
}
});
}

最佳答案

可能的发现..

  1. 使用调试并找到错误。
  2. 从项目中检查默认运行>properties>运行并检查默认主类;
  3. 删除所有代码并重写主类;

建议:应该有错误信息。你应该发布那个。

关于java - 我的 java swing 表单无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16122191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com