我有一个控制器,我的按钮的动作事件在该控制器上打开一个子阶段。问题是当我关闭父阶段时,子阶段也会关闭。只要子阶段打开,我想防止父阶段关闭。
URL url = getClass().getResource("Message.fxml");
FXMLLoader fxmlLoader = new FXMLLoader();
fxmlLoader.setLocation(url);
fxmlLoader.setBuilderFactory(new JavaFXBuilderFactory());
root = (Parent)fxmlLoader.load(url.openStream());
Stage stage = new Stage();
//stage.initStyle(StageStyle.UNDECORATED);
//stage.setFullScreen(true);
stage.setTitle("Welcome User");
stage.setScene(new Scene(root, 675,
stage.show();