Actually exit on exit.

Didn't notice this in the IDE but running from the terminal it was hard not to notice.
1 files changed, 10 insertions(+), 0 deletions(-)

M src/main/java/com/ajtjp/gearcityuserinterface/Main.java
M src/main/java/com/ajtjp/gearcityuserinterface/Main.java +10 -0
@@ 17,8 17,10 @@ import javafx.stage.Stage;
 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 @@ public class Main extends Application {
 
     @Override
     public void start(Stage stage) throws Exception {
+        
+        stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
+            @Override
+            public void handle(WindowEvent t) {
+                Platform.exit();
+                System.exit(0);
+            }
+        });
 
         theStage = stage;
         File file = null;