📅  最后修改于: 2022-03-11 14:52:25.206000             🧑  作者: Mango
public void start(Stage stage) throws Exception {
FXMLLoader ldr = new FXMLLoader(getClass()
.getResource("Application.fxml"));
Parent root = (Parent) ldr.load();
appCtrl = (ApplicationController) ldr.getController();
Scene scene = new Scene(root);
stage.setScene(scene);
stage.show();
scene.getWindow().setOnCloseRequest(new EventHandler() {
public void handle(WindowEvent ev) {
if (!appCtrl.shutdown()) {
ev.consume();
}
}
});
}