title: Not responsive. Changing between scenes JavaFX.
body: <p>I am trying to change my FXML files in one Stage, in borderPane>CENTER. It is working but the second FXML file is not responsive. Could someone help ?</p>
  
  <p>Here are my files.</p>
  
  <p>Main.java (only start method)</p>
  
  <pre><code>@Override
  public void start(Stage primaryStage) {
      try {
          Parent root = FXMLLoader.load(getClass().getResource("fxml1.fxml"));
  
            Stage  stage = primaryStage;
              Scene scene = new Scene(root, 300, 275);
  
              stage.setTitle("FXML Welcome");
              stage.setScene(scene);
              stage.show();
      } catch(Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>My controller.</p>
  
  <pre><code>public class fxmlTESTcontroller {
  
      @FXML
      private Button changeScene1;
  
      @FXML
      private VBox change;
  
  
      @FXML
      void changeSceneMethod(ActionEvent e) throws IOException
      {
          change.getChildren().clear();
          change.getChildren().add(FXMLLoader.load(getClass().getResource("fxml2.fxml")));
      }
  }
  </code></pre>
  
  <p>FXML 1</p>
  
  <pre><code>&lt;AnchorPane xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.fxmlTESTcontroller"&gt;
     &lt;children&gt;
        &lt;BorderPane prefHeight="300.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"&gt;
           &lt;left&gt;
              &lt;ListView maxWidth="200.0" BorderPane.alignment="CENTER" /&gt;
           &lt;/left&gt;
           &lt;center&gt;
              &lt;VBox fx:id="change" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER"&gt;
                 &lt;children&gt;
                    &lt;GridPane VBox.vgrow="ALWAYS"&gt;
                      &lt;columnConstraints&gt;
                        &lt;ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /&gt;
                        &lt;ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /&gt;
                      &lt;/columnConstraints&gt;
                      &lt;rowConstraints&gt;
                        &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
                        &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
                        &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
                      &lt;/rowConstraints&gt;
                       &lt;children&gt;
                          &lt;Text strokeType="OUTSIDE" strokeWidth="0.0" text="Text" /&gt;
                          &lt;Text strokeType="OUTSIDE" strokeWidth="0.0" text="Text" GridPane.columnIndex="1" /&gt;
                          &lt;TextField GridPane.columnIndex="1" GridPane.rowIndex="1" /&gt;
                          &lt;TextArea prefHeight="200.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="2" /&gt;
                          &lt;Text strokeType="OUTSIDE" strokeWidth="0.0" text="Text" GridPane.rowIndex="1" /&gt;
                          &lt;Text strokeType="OUTSIDE" strokeWidth="0.0" text="Text" GridPane.rowIndex="2" /&gt;
                       &lt;/children&gt;
                    &lt;/GridPane&gt;
                    &lt;HBox&gt;
                       &lt;children&gt;
                          &lt;Pane HBox.hgrow="ALWAYS" /&gt;
                          &lt;Button fx:id="changeScene1" mnemonicParsing="false" onAction="#changeSceneMethod" text="Button" HBox.hgrow="ALWAYS" /&gt;
                       &lt;/children&gt;
                    &lt;/HBox&gt;
                 &lt;/children&gt;
              &lt;/VBox&gt;
           &lt;/center&gt;
        &lt;/BorderPane&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>and FXML 2</p>
  
  <pre><code>&lt;VBox xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8" prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER"&gt;
     &lt;children&gt;
        &lt;GridPane VBox.vgrow="ALWAYS"&gt;
          &lt;columnConstraints&gt;
            &lt;ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" /&gt;
            &lt;ColumnConstraints hgrow="ALWAYS" minWidth="10.0" prefWidth="100.0" /&gt;
          &lt;/columnConstraints&gt;
          &lt;rowConstraints&gt;
            &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
            &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /&gt;
            &lt;RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" /&gt;
          &lt;/rowConstraints&gt;
           &lt;children&gt;
              &lt;Button mnemonicParsing="false" text="Button" GridPane.columnIndex="1" /&gt;
              &lt;Label text="Label" /&gt;
              &lt;Label text="Label" GridPane.rowIndex="1" /&gt;
              &lt;Label text="Label" GridPane.columnIndex="1" GridPane.rowIndex="1" /&gt;
              &lt;Label text="Label" GridPane.rowIndex="2" /&gt;
              &lt;TextArea GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2" GridPane.vgrow="ALWAYS" /&gt;
           &lt;/children&gt;
        &lt;/GridPane&gt;
        &lt;HBox VBox.vgrow="ALWAYS"&gt;
           &lt;children&gt;
              &lt;Pane HBox.hgrow="ALWAYS" /&gt;
              &lt;Button mnemonicParsing="false" text="Button" HBox.hgrow="ALWAYS" /&gt;
           &lt;/children&gt;
        &lt;/HBox&gt;
     &lt;/children&gt;
  &lt;/VBox&gt;
  </code></pre>
  
  <p>And here are the pictures of my <a href="http://i.stack.imgur.com/ezbYQ.png" rel="nofollow">FXML1 (responsive)</a> and <a href="http://i.stack.imgur.com/WqUKe.png" rel="nofollow">FXML2 (not responsive)</a> after I run the app.</p>
  
  <p>Could someone explain me why is that ?</p>