1 Reply Latest reply: Dec 19, 2012 8:38 AM by James_D RSS

    how to get the parent window in sub-child controller class in javafx?

    980758
      how to get the parent window in sub-child controller class in javafx?
        • 1. Re: how to get the parent window in sub-child controller class in javafx?
          James_D
          You can get the window in which a node is contained with
          Window window = node.getScene().getWindow();
          Depending when this is invoked, you might want to check the Scene is not null before calling getWindow().

          If the window is a stage that is owned by another window, you can get the "parent" or "owner" window with
          Window owner = null ;
          if (window instanceof Stage) {
            Stage stage = (Stage) window ;
            owner = stage.getOwner();
          }