javafx - how to get reference to main Stage in MainController in initialize() method?
<p>I need to get reference to main Stage of app in initialize() method in MainController. I tried using this solution:</p>

<pre><code>    ...
@FXML private Label label;
...
// in some method block
Stage stageTheLabelBelongs = (Stage) label.getScene().getWindow();
</code></pre>

<p>but other label (or other controlls) doesn't exist when application call initialize() and it returns NullPointerException. How to avoid this?
Greetings</p>