title: Pane -> Hbox -> ImageView fit height
body: <p>I have ImageView inside HBox inside Pane, and want ImageView height fit HBox height when resizing stage. Trying the following code</p>
  
  <pre><code>package sample;
  
  import javafx.application.Application;
  import javafx.geometry.Insets;
  import javafx.scene.Scene;
  import javafx.scene.image.ImageView;
  import javafx.scene.layout.*;
  import javafx.scene.paint.Color;
  import javafx.stage.Stage;
  
  public class Main extends Application {
  
      @Override
      public void start(Stage primaryStage) {
          Pane pane = new Pane();
          pane.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY)));
          HBox hBox = new HBox();
          hBox.setBackground(new Background(new BackgroundFill(Color.GREEN, CornerRadii.EMPTY, Insets.EMPTY)));
          hBox.setPrefHeight(100);
          hBox.setPrefWidth(100);
          hBox.prefHeightProperty().bind(pane.heightProperty());
          ImageView imageView = new ImageView("http://www.calgary.ca/CA/city-manager/scripts/about-us/webparts/images/ourHistory_retina.jpg");
          imageView.fitHeightProperty().bind(hBox.heightProperty());
          imageView.setPreserveRatio(true);
          hBox.getChildren().add(imageView);
          pane.getChildren().add(hBox);
          primaryStage.setScene(new Scene(pane, 300, 275));
          primaryStage.show();
      }
  
  
      public static void main(String[] args) {
          launch(args);
      }
  }
  </code></pre>
  
  <p>When starting, ImageView is not fit windows height, it shown in it's original size. And it scales only up when I resize window to make it bigger, then original image size.</p>
  
  <p>Also I see, that <code>hBox.prefHeightProperty().bind(pane.heightProperty())</code> works perfectly (height of red HBox background behind image is corresponding window height).</p>
  
  <p>So it seems <code>imageView.fitHeightProperty().bind(hBox.heightProperty())</code> behaves not as I expecting.</p>
  
  <p>How can I make ImageView fit <strong>height</strong> of HBox, nested in Pane?</p>