Visualiser Closes All threads on exit now.

- Added override for exiting the Visualiser which closes all threads: such as the TCP connection.
#story[782]
main
Fan-Wu Yang 9 years ago
parent a20dafea11
commit d52b09e74a

@ -1,11 +1,14 @@
package seng302;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.EventHandler;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
public class App extends Application {
Stage primaryStage;
@ -22,6 +25,13 @@ public class App extends Application {
}
public void start(Stage stage) throws Exception {
stage.setOnCloseRequest(new EventHandler<WindowEvent>() {
@Override
public void handle(WindowEvent event) {
Platform.exit();
System.exit(0);
}
});
FXMLLoader loader = new FXMLLoader(getClass().getResource("/scenes/main.fxml"));
Parent root = loader.load();
Scene scene = new Scene(root, 1200, 800);

Loading…
Cancel
Save