Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的代码中,我使用了:
Application.launch(MyDesign.getClass(), null);
从单独的类运行 MyDesign 的 UI。当它调用时launch(),它执行MyDesign类的构造函数。我之前创建了一个MyDesign对象并初始化了它的属性。所以我在调用后得到了一个新对象launch()。当我调用时,我需要停止调用它的构造函数
launch()
MyDesign
Application.launch().
非常感谢您的反馈。谢谢。
不幸的是,您不能通过Application.launch().
Application.launch()
您可以使用下一个存根应用程序并启动它:
public class Runner extends Application { @Override public void start(Stage stage) throws Exception { myDesignInstance.start(stage); } }