Reputation: 1
I am trying to make a LWJGL
game run a JavaFX
application and the game, then close only the JavaFX
application, but doing System.exit(0)
closes both windows.
How can I get the desired result
Upvotes: 0
Views: 96
Reputation: 358
You can create a common close function where You just need to pass Node. Node can be Button, ComboBox, TextField etc.
public static Stage closeConfirmView(Node node) throws IOException {
Stage primaryStage = (Stage) node.getScene().getWindow();
primaryStage.close();
return primaryStage;
}
Upvotes: 1