On JavaFX, how to hide stage without disposing it and closing the application?

Once the JavaFX toolkit has started, by default it will close down when the last visible window is closed.

To prevent this, you can call

Platform.setImplicitExit(false);

You typically do this in your start(...) method, though it can be called from any thread.

To exit the application, you would then need to call

Platform.exit();

(as the application no longer exits automatically).

Leave a Comment