javafx Anonymous Application class

安稳与你 提交于 2019-12-01 13:01:15

Please note that launch is a static method so it does not know you are calling it on the Anonymous Application-Instance you created!

The best idea i have is that you make you code look like this:

public static void main(String [] args)
{
   Application.launch( MyApp.class, args );
}

public static class MyApp extends Application {
  public void start(Stage stage)
  {
          stage.setTitle( "Test" );
          Scene scene = new Test( new Group(), 450, 250);
          stage.setScene( scene );
          stage.show();
   }
 }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!