2 Replies Latest reply: Nov 25, 2012 9:07 AM by 883781 RSS

    How to access a stage from a FXML controller class?

    925065
      Is it possible to access the stage inside a controller?
      In my case I would like to open a file chooser dialogue from an action event handle method like this:
      @FXML
      protected void handleMenuItemAction(final ActionEvent event) {
          final FileChooser fileChooser = new FileChooser();
          final File importFile = fileChooser.showOpenDialog(stage.getOwner());
          ...
      }