I\'m trying to launch a JavaFx application from within a JavaFx application, but it looks like Application.launch() can only be called once. Does this mean I have to start a
If you want to execute another JavaFX application in the same JVM you can just create instance of it, manually create Stage
and call Application#start()
public void runAnotherApp(Class extends Application> anotherAppClass) throws Exception {
Application app2 = anotherAppClass.newInstance();
Stage anotherStage = new Stage();
app2.start(anotherStage);
}
N.B.: it wouldn't work if you use special features of standard initialization in anotherApp, e.g. Application.init()
or Application.getParameters()