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).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…