title: How to automatically resize JavaFX containers when window is maximized?
body: <p>Basically, I have the following document:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import com.jfoenix.controls.JFXButton?&gt;
  &lt;?import com.jfoenix.controls.JFXTabPane?&gt;
  &lt;?import com.jfoenix.controls.JFXTreeView?&gt;
  &lt;?import javafx.geometry.Insets?&gt;
  &lt;?import javafx.scene.control.Separator?&gt;
  &lt;?import javafx.scene.control.Tab?&gt;
  &lt;?import javafx.scene.control.TableColumn?&gt;
  &lt;?import javafx.scene.control.TableView?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  &lt;?import javafx.scene.layout.BorderPane?&gt;
  &lt;?import javafx.scene.layout.HBox?&gt;
  &lt;?import javafx.scene.layout.StackPane?&gt;
  &lt;?import javafx.scene.layout.VBox?&gt;
  &lt;?import javafx.scene.text.Font?&gt;
  
     &lt;BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="566.0" prefWidth="753.0" xmlns="http://javafx.com/javafx/8.0.141" xmlns:fx="http://javafx.com/fxml/1" fx:controller="gui.controller"&gt;
      &lt;center&gt;
          &lt;JFXTabPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" BorderPane.alignment="CENTER"&gt;
              &lt;tabs&gt;
                  &lt;Tab text="TAB"&gt;
                      &lt;content&gt;
                          &lt;AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"&gt;
                              &lt;children&gt;
                                  &lt;VBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="495.0" prefWidth="753.0"&gt;
                                      &lt;children&gt;
                                          &lt;StackPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="150.0" prefWidth="200.0" VBox.vgrow="ALWAYS"&gt;
                                              &lt;children&gt;
                                                  &lt;HBox maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" nodeOrientation="LEFT_TO_RIGHT" prefHeight="100.0" prefWidth="200.0"&gt;
                                                      &lt;children&gt;
                                                          &lt;JFXTreeView fx:id="treeView" /&gt;
                                                          &lt;TableView  maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="277.0" prefWidth="753.0"&gt;
                                                              &lt;columns&gt;
                                                                  &lt;TableColumn maxWidth="-1.0" text="COL" /&gt;
                                                                  &lt;TableColumn text="COL" /&gt;
                                                                  &lt;TableColumn text="COL" /&gt;
                                                                  &lt;TableColumn text="COL" /&gt;
                                                                  &lt;TableColumn minWidth="0.0" text="COL" /&gt;
                                                                  &lt;TableColumn text="COL" /&gt;
                                                              &lt;/columns&gt;
                                                              &lt;columnResizePolicy&gt;
                                                                  &lt;TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /&gt;
                                                              &lt;/columnResizePolicy&gt;
                                                          &lt;/TableView&gt;
                                                      &lt;/children&gt;
                                                  &lt;/HBox&gt;
                                              &lt;/children&gt;
                                          &lt;/StackPane&gt;
                                      &lt;/children&gt;
                                  &lt;/VBox&gt;
                              &lt;/children&gt;
                          &lt;/AnchorPane&gt;
                      &lt;/content&gt;
                  &lt;/Tab&gt;
              &lt;/tabs&gt;
          &lt;/JFXTabPane&gt;
      &lt;/center&gt;
  &lt;/BorderPane&gt;
  </code></pre>
  
  <p>The main class to load the FXML document:</p>
  
  <pre><code>import javafx.application.Application;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.layout.BorderPane;
  import javafx.stage.Stage;
  
  public class Main extends Application {
  
      public static void main(String[] args) {
          launch(args);
      }
  
      @Override
      public void start(Stage primaryStage) throws Exception {
  
          BorderPane parent = (BorderPane)  FXMLLoader.load(getClass().getResource("document.fxml"));
          Scene scene = new Scene(parent);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  }
  </code></pre>
  
  <p>When i maximize the window, the table and the rest of the containers don't resize accordingly. I tried to set <code>Max Width</code> and <code>Max Height</code> for all the containers to <code>MAX_VALUE</code> in SceneBuilder but nothing really happens. <br><br>
  Is there a way to automatically expand the containers so that they can use all the space when the window is maximized ?</p>