Tuesday, December 19, 2017

JAVAFX - How close form (=stage)

Get Stage - for example from button and then close form.
@FXML Button btnClose;

@FXML private void btnCloseAction( ActionEvent event ) {
  Stage stage = (Stage) btnClose.getScene().getWindow();    
  stage.close();    
}

No comments:

Post a Comment