title: Binding Rectangle.widthProperty() to its parent width does not work
body: <p>I would like to place an <code>HBox</code> with a red rectangle in the middle of a <code>BorderPane</code>, and I would like that rectangle to grow or shrink with its container (the HBox).
  This is my code:</p>
  
  <pre><code>public class Test extends Application {
  
      @Override
      public void start(Stage primaryStage) {
          BorderPane borderPane = new BorderPane();
          HBox hBox = new HBox();
  
          hBox.setAlignment(Pos.CENTER);
  
          Rectangle rect = new Rectangle(hBox.getWidth(),50);
          rect.setFill(Color.RED);
          rect.widthProperty().bind(hBox.widthProperty().subtract(20));
  
          hBox.getChildren().add(rect);
  
          borderPane.setCenter(hBox);     
  
          Scene scene = new Scene(borderPane, 900, 600, Color.WHITE);
  
          primaryStage.setScene(scene);
          primaryStage.show();
  
      }
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>But it doesn't work. When I slowly resize my Frame, it works, nevertheless, when I quickly resize my Frame, the rectangle is not in the middle (not the same size too) and we can see the same things when we minimize and maximize the Frame.</p>
  
  <p>I don't understand why it doesn't work.</p>