JavaFX / FXML - Get Height of a VBox
<p>I have the following problem. I've got this VBox wrapped in an AnchorPane:</p>

<pre><code>&lt;AnchorPane&gt;
   &lt;children&gt;
      &lt;VBox fx:id="sidebar" prefHeight="400.0" prefWidth="150.0" AnchorPane.bottomAnchor="0.0" AnchorPane.topAnchor="0.0"/&gt;
   &lt;/children&gt;
&lt;/AnchorPane&gt;
</code></pre>

<p>And I want to get the displayed height of this vbox (even after e.g. resizing the Anchorpane around it.) <br> So I tried the following:</p>

<pre><code>double height = sidebar.getHeight();
</code></pre>

<p>but for some reason getHeight() just returns 0. So... how do I get the height of that vbox?</p>