title: Javafx stage is null
body: <p>I have two controllers here <code>authcontroller</code> and <code>maincontroller</code>. Method register opens new window - register.fxml. </p>
  
  <pre><code>register.setOnAction(new EventHandler&lt;ActionEvent&gt;() {
              public void handle(ActionEvent event) {
                  Stage stage = new Stage();
                  AnchorPane pane = null;
                  try {
                      pane = FXMLLoader.load(getClass().getResource("/fxml/register.fxml"));
                  } catch (IOException e) {
                      e.printStackTrace();
                  }
  
                  stage.setTitle("Регистрация в системе");
                  Scene scene = new Scene(pane, 600, 450);
                  stage.setResizable(false);
                  stage.setScene(scene);
                  stage.show();
              }
          });
  </code></pre>
  
  <p>And then in second controller I have method initialize, where I try to get <code>Stage</code> from first window. </p>
  
  <pre><code>@Override
      public void initialize(URL location, ResourceBundle resources)  {
      Stage stage = (Stage) tabOnePane.getScene().getWindow();
  
  }
  </code></pre>
  
  <p><code>tabOnePane</code> is tabpane from second window. But when I try to do this, my <code>Stage</code> is always null. But if I try to get <code>Stage</code> inside another handle-method I can do it. How to get <code>Stage</code> of first window when my second window has loaded?</p>
  
  <p>second controller implements interface <code>Initializable</code></p>