I'm trying to get my JavaFX Application to launch other Classes through a button click using this code:
btn.setOnAction(click -> {ClientMain.main(new String[]{});});
However this generates the following exception:
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException: Application launch must not be called more than once
The class I'm trying to launch, ClientMain, extends Application, and I've managed to get an instance of it running by simply calling its start() method.
However, I need the application to run on a separate JVM than the caller's. How could I solve this?
Let me know if details are needed.