我试图通过单击一个按钮来打开一个舞台,但在打开它之前,我想检查舞台是否已经打开,然后将打开的舞台弹出到前面而不是打开一个新的舞台(没有相同的多重打开)阶段)。
@FXML
private void btn_Validate(ActionEvent event) {
try {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/scontrols/students/StudentManagement.fxml"));
Parent root = (Parent) loader.load();
StudentManagementController sendTo = loader.getController();
sendTo.receiveFromCamera(txtPictureName.getText());
Stage stage = new Stage();
stage.setScene(new Scene(root));
if(!stage.isShowing())
{
stage.show();}
} catch (IOException ex) {
Logger.getLogger(WebCamController.class.getName()).log(Level.SEVERE, null, ex);
}
}
翻翻过去那场雪
相关分类