Hello I have a little big problem in JavaFX application with terminating java process when all brower windows are closed. I was trying to handle Stage.setOnHiding or .setOnCloseRequest and terminate all running threads and do Platform.exit in the handler body, but with no luck. First of all none of handlers setOnHiding and setOnCloseRequest are invoked when I’m closing browser. Also setting Platform.setImplicitExit(true) does not cause java process to terminate when browser is closed – this works only sometimes. Sth prevents javafx process from being killed after web browser is closed. How can I detect what ?
Hello I have a little big problem in JavaFX application with terminating java process
Share
For me, JavaFX applications hosted in a browser always terminate automatically when the browser is closed.
You should implement Application.stop() to detect the application shutdown event.
Stage level methods setOnCloseRequest and setOnHiding are not the right methods for detecting an application level shutdown event.