title: Fill width in a Pane
body: <p>There is a <code>Pane</code> as root and a <code>GridPane</code> as its child. The root resizes with the stage. How can I achieve that the <code>GridPane</code> gets <strong>automatically</strong> resized with the root to fill the width? <strong>Any width should possible.</strong> Is it possible without property binding?</p>
  
  <p>This is the situation:</p>
  
  <ol>
  <li>A <code>Pane</code> <strong>root</strong> (yellow) is the root of the <code>Scene</code> so it fills the width and height of the <code>Stage</code>.</li>
  <li>A <code>GridPane</code> (green) with one row and 3 colums as child of <strong>root</strong>.</li>
  <li>The row should have a fixed height.</li>
  <li>The first and third column should have a constant size</li>
  <li>The middle column should grow to maximum</li>
  <li>The <code>GridPane</code> should fill the width of its parent</li>
  </ol>
  
  <p>Unfortunately the <code>GridPane</code> does not fill the width:
  <a href="https://i.stack.imgur.com/Cacz3.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Cacz3.png" alt="GridPane should fill the width of its parent"></a></p>
  
  <p>Code:</p>
  
  <pre><code>@Override
  public void start(Stage primaryStage) throws Exception {
      // Resizes with the stage
      final Pane root = new Pane();
      root.setStyle("-fx-background-color: yellow");
  
      // grid: 1 row, 3 colums
      // should have a constant height and should grow in width to fill parent pane
      final GridPane gridPane = new GridPane();
      root.getChildren().add(gridPane);
      gridPane.setStyle("-fx-background-color: green");
      gridPane.setGridLinesVisible(true);
  
      final RowConstraints row = new RowConstraints(100); // constant height = 100
      final ColumnConstraints col1 = new ColumnConstraints(100, Control.USE_COMPUTED_SIZE, Control.USE_COMPUTED_SIZE);
      // should grow as much as possible in width
      final ColumnConstraints col2 = new ColumnConstraints(200, Control.USE_COMPUTED_SIZE, Double.MAX_VALUE);
      final ColumnConstraints col3 = new ColumnConstraints(100, Control.USE_COMPUTED_SIZE, Control.USE_COMPUTED_SIZE);
      gridPane.getRowConstraints().add(row);
      gridPane.getColumnConstraints().addAll(col1, col2, col3);
  
      final Scene scene = new Scene(root);
      primaryStage.setScene(scene);
      primaryStage.setWidth(600);
      primaryStage.setHeight(400);
      primaryStage.show();
  }
  </code></pre>