Application is not just a window — it’s a Process
. Thus only one Application#launch()
is allowed per VM.
If you want to have a new window — create a Stage
.
If you really want to reuse anotherApp
class, just wrap it in Platform.runLater()
@Override
public void update(Observable o, Object arg) {
Platform.runLater(new Runnable() {
public void run() {
new anotherApp().start(new Stage());
}
});
}