title: JavaFX - Need help seting Stage upon initialize
body: <p>I keep getting a <code>null</code> reference exception when I try to set my stage to a variable upon initialization.</p>
  
  <p>my code.</p>
  
  <pre><code>public class ListController implements Initializable {
          private Stage thisStage;
  
          @Override
          public void initialize(URL location, ResourceBundle resources) {
              lblCount.setText("Hey"); //This works
  
              thisStage = (Stage) lblCount.getScene().getWindow(); //this doesn't
          }
  
          public ListController()
          {
              thisStage = (Stage) lblCount.getScene().getWindow(); //this doesn't
          }
  }
  </code></pre>
  
  <p>I tried to use a constructor and that didn't work neither.</p>