title: Make ScrollPane fit to its parent in javafx
body: <p>I want to resize ScrollPane as it fits to its the parent container. I tested this code:</p>
  
  <pre><code>    @Override
      public void start(Stage stage) throws Exception {
  
          VBox vb = new VBox();
          vb.setPrefSize(600, 600);
          vb.setMaxSize(600, 600);
  
          ScrollPane scrollPane = new ScrollPane();
          scrollPane.setFitToHeight(false);
          scrollPane.setFitToWidth(false);
  
          scrollPane.setHbarPolicy(ScrollBarPolicy.AS_NEEDED);
          scrollPane.setVbarPolicy(ScrollBarPolicy.AS_NEEDED);
  
          VBox vb2 = new VBox();
  
          vb.getChildren().add(scrollPane);
          scrollPane.getChildren().add(vb2);
  
          Scene scene = new Scene(vb);
  
          stage.setScene(scene);
          stage.show();
      }
  </code></pre>
  
  <p>Now I want to make scrollPane width, height same as outer VBox(vb). But I was failed! Can anybody help me please?</p>