Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/309.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
我的java swing表单将不会启动_Java_Swing_Runnable - Fatal编程技术网

我的java swing表单将不会启动

我的java swing表单将不会启动,java,swing,runnable,Java,Swing,Runnable,我以前使用此代码启动过此表单,但对表单进行多次编辑后,它将不再启动。有什么建议吗 public static void main(String args[]) { try { for (javax.swing.UIManager.LookAndFeelInfo info: javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { ja

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

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);
    }
  });
}
publicstaticvoidmain(字符串参数[]){
试一试{
for(javax.swing.UIManager.LookAndFeelInfo:javax.swing.UIManager.getInstalledLookAndFeels()){
if(“Nimbus”.equals(info.getName())){
setLookAndFeel(info.getClassName());
打破
}
}
}catch(ClassNotFoundException |实例化Exception | IllegalacessException | javax.swing.UnsupportedLookAndFeelException ex){
getLogger(register.class.getName()).log(java.util.logging.Level.SEVERE,null,ex);
}
//
/*创建并显示表单*/
invokeLater(new Runnable()){
@凌驾
公开募捐{
新注册器().setVisible(true);
}
});
}
可能的发现

  • 使用“调试”并查找错误
  • 从项目>属性>运行中选中默认运行,并选中默认主类
  • 删除所有代码并重新编写主类
    建议:应该有一条错误消息。您应该发布这些信息。

    应用程序可能无法启动的原因很多。发布一篇寻求更好帮助的文章,soonerI不确定该删减什么,因为上面说项目需要构建successfully@TYGYR如果您能展示什么是
    register
    类以及它的功能,那就太好了。它是一个
    JFrame
    ?或者,如果您的项目很小,请将其全部发布。@LittleChild在Java中被认为是1200行小的吗?@LittleChild是对的;从头开始创建一个GUI编辑器是一种将问题缩小到一定大小并使GUI编辑器不碍事的方法。还可以在
    Team>History
    中查找出现问题的时间。