# HG changeset patch # User Andrew # Date 1685916998 14400 # Sun Jun 04 18:16:38 2023 -0400 # Node ID a6102c6a1c443cc67aaa44445923fac0fb44e22c # Parent ddf35e9e14c0d5b0184a952044dfc17a4bcf52d5 Actually exit on exit. Didn't notice this in the IDE but running from the terminal it was hard not to notice. diff --git a/src/main/java/com/ajtjp/gearcityuserinterface/Main.java b/src/main/java/com/ajtjp/gearcityuserinterface/Main.java --- a/src/main/java/com/ajtjp/gearcityuserinterface/Main.java +++ b/src/main/java/com/ajtjp/gearcityuserinterface/Main.java @@ -17,8 +17,10 @@ import javafx.stage.FileChooser; import static javafx.application.Application.launch; import javafx.application.Platform; +import javafx.event.EventHandler; import javafx.scene.control.Alert; import javafx.scene.control.ButtonType; +import javafx.stage.WindowEvent; /** * @@ -42,6 +44,14 @@ @Override public void start(Stage stage) throws Exception { + + stage.setOnCloseRequest(new EventHandler() { + @Override + public void handle(WindowEvent t) { + Platform.exit(); + System.exit(0); + } + }); theStage = stage; File file = null;