title: How to bind stage resizing with resizing of components?
body: <p>I have a JavaFX 2.0 application with FXML.
  I want the components (TextFields, ComboBoxes, layouts, and so on) to be resized when a window with an application is resized. 
  So...</p>
  
  <ul>
  <li>As it is written on <a href="https://docs.oracle.com/javase/8/javafx/properties-binding-tutorial/binding.htm" rel="nofollow noreferrer">Oracle documentation for JavaFX</a>, to make something like this with shapes, there are a few special properties to shapes:</li>
  </ul>
  
  <blockquote>
    <p>When building GUI applications with JavaFX, you will notice that certain classes in the API already implement properties. For example, the <code>javafx.scene.shape.Rectangle</code> class contains properties for <code>arcHeight</code>, <code>arcWidth</code>, <code>height</code>, <code>width</code>, <code>x</code>, and <code>y</code>. For each of these properties there will be corresponding methods that match the conventions previously described. For example, <code>getArcHeight()</code>, <code>setArcHeight(double)</code>, <code>arcHeightProperty()</code>, which together indicate (to both developers and tools) that the given property exists.*</p>
  </blockquote>
  
  <ul>
  <li><p>To add listener to a stage I have to do something like:</p>
  
  <pre><code>   stage.resizableProperty().addListener(new ChangeListener&lt;Boolean&gt;(){
      @Override
      public void changed(ObservableValue&lt;? extends Boolean&gt; arg0, Boolean arg1, Boolean arg2){
          throw new UnsupportedOperationException("Not supported yet.");
      }
  
  });
  </code></pre></li>
  </ul>
  
  <p>So there are two questions:</p>
  
  <ul>
  <li>To make some binding I have to get my stage in the controller class. So - how can I get a stage in a controller class?</li>
  <li>It looks like UI controls do not have any width\height properties, to be bound to something. Or perhaps I have not found them.</li>
  </ul>
  
  <p>So, how can I solve my problem?</p>
  
  <p><strong><em>UPD</strong>. About Scene Builder to Sergey Grinev:</em> When I use <em>Ctrl+K</em> on my component (tell it to occupy the whole area of its parent component) - everything is ok.</p>
  
  <p>But what if I want to tell my component to occupy <strong>50%</strong> of an area? 
  For exammple I have a tab with two VBoxes on it. 
  The tab's width is <strong>100px</strong>. The Vbox's widths are <strong>50px</strong> for each. VBox1 has <strong>x1=0</strong>, and <strong>x2=50</strong>, and VBox2 has <strong>x1=50</strong>, and <strong>x2=100</strong>. 
  Then I resize my window with JavaFX application. 
  Now I have tab's Width = <strong>200px</strong>. 
  But my VBoxes widths are still = <strong>50px</strong>: VBox1 has <strong>x1=0</strong>, and <strong>x2=50</strong>, and VBox2 has <strong>x1=150</strong>, and <strong>x2=200</strong>. 
  And I need them to be VBox1 <strong>x1=0</strong> and <strong>x2=100</strong> and VBox2 <strong>x1=100</strong> and <strong>x2=200</strong>. 
  Where x1 and x2 values are the coordinates of VBoxes corners. </p>
  
  <p>How can Scene Builder help me in this situation?</p>