小编Ara*_*ash的帖子

如何打开两个Javafx窗口?

我正在使用javafx,想在一个按钮的'setOnAction'中编写代码来关闭javafx1类和运行javafx2类,但我看到错误'应用程序启动不能多次调用'.我怎样才能解决这个问题?

//This code is in the class JavaFX1:
button.setOnAction(new EventHandler<ActionEvent>() {
      @Override
      public void handle(ActionEvent event) {
          JavaFX2.main(null); //How can i change current line?
          stage.close();
      }
});
Run Code Online (Sandbox Code Playgroud)

javafx launch application-error

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

application-error ×1

javafx ×1

launch ×1