cancel javafx stage exit request

Solutions on MaxInterview for cancel javafx stage exit request by the best coders in the world

showing results for - "cancel javafx stage exit request"
Gaia
16 Jan 2017
1public void start(Stage stage) throws Exception {
2    FXMLLoader ldr = new FXMLLoader(getClass()
3                .getResource("Application.fxml"));
4    Parent root = (Parent) ldr.load();
5    appCtrl = (ApplicationController) ldr.getController();
6
7    Scene scene = new Scene(root);
8
9    stage.setScene(scene);
10    stage.show();
11
12    scene.getWindow().setOnCloseRequest(new EventHandler<WindowEvent>() {
13        public void handle(WindowEvent ev) {
14            if (!appCtrl.shutdown()) {
15                ev.consume();
16            }
17        }
18    });
19}
20
similar questions
queries leading to this page
cancel javafx stage exit request