title: JavaFX Scale Elements to Screen Resolution
body: <p>I've created a GUI in JavaFX using SceneBuilder that works perfectly in windowed mode. It looks like this;</p>
  
  <p><a href="https://i.stack.imgur.com/VbySe.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VbySe.jpg" alt="enter image description here"></a></p>
  
  <p>What I would like to do is run the program maximised (not full screen) and ideally have the elements resize according to whether the stage is maximised or not. This is what the GUI looks like when the program is maximised;</p>
  
  <p><a href="https://i.stack.imgur.com/ycNvw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ycNvw.jpg" alt="enter image description here"></a></p>
  
  <p>As you can see for some bizzare reason the table does "scale" however none of the other elements do. Is there a setting in SceneBuilder I can use that makes the elements fluid?</p>
  
  <p>FXML code for displayed page;</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.shape.*?&gt;
  &lt;?import javafx.scene.text.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.layout.GridPane?&gt;
  
  &lt;AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="-Infinity" minWidth="-Infinity" onKeyPressed="#handleRefresh" prefHeight="634.0" prefWidth="602.0" stylesheets="@Style.css" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1"&gt;
     &lt;children&gt;
        &lt;TableView fx:id="tView" layoutX="20.0" layoutY="159.0" onKeyPressed="#handleRefresh" prefHeight="389.0" prefWidth="601.0" AnchorPane.bottomAnchor="86.0" AnchorPane.leftAnchor="20.0" AnchorPane.rightAnchor="31.0" AnchorPane.topAnchor="159.0"&gt;
          &lt;columns&gt;
            &lt;TableColumn fx:id="caseNumCol" prefWidth="75.0" text="CaseNO" /&gt;
            &lt;TableColumn fx:id="caseNotesCol" prefWidth="75.0" text="Case Notes" /&gt;
              &lt;TableColumn fx:id="dateCreatedCol" prefWidth="75.0" text="Date Created" /&gt;
              &lt;TableColumn fx:id="deadlineDateCol" prefWidth="75.0" text="Deadline" /&gt;
              &lt;TableColumn fx:id="priorityCol" prefWidth="75.0" text="Priority" /&gt;
              &lt;TableColumn fx:id="completedCol" prefWidth="75.0" text="Completed" /&gt;
          &lt;/columns&gt;
           &lt;columnResizePolicy&gt;
              &lt;TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /&gt;
           &lt;/columnResizePolicy&gt;
        &lt;/TableView&gt;
        &lt;Button layoutX="66.0" layoutY="559.0" mnemonicParsing="false" onAction="#handleAddButtonAction" prefHeight="25.0" prefWidth="79.0" text="Add Job" /&gt;
        &lt;Button layoutX="322.0" layoutY="559.0" mnemonicParsing="false" onAction="#handleDeleteButtonAction" prefHeight="25.0" prefWidth="79.0" text="Delete Job" /&gt;
        &lt;Label layoutX="14.0" layoutY="6.0" prefHeight="58.0" prefWidth="245.0" text="SDC Job Manager"&gt;
           &lt;font&gt;
              &lt;Font name="System Bold" size="28.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Line endX="500" layoutX="101.0" layoutY="72.0" startX="-100.0" /&gt;
        &lt;Label fx:id="adamLabel" alignment="CENTER" layoutX="153.0" layoutY="98.0" prefHeight="30.0" prefWidth="295.0" text="Adam's Jobs" visible="false"&gt;
           &lt;font&gt;
              &lt;Font size="24.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Label fx:id="kitLabel" alignment="CENTER" layoutX="153.0" layoutY="98.0" prefHeight="30.0" prefWidth="295.0" text="Kit's Jobs" visible="false"&gt;
           &lt;font&gt;
              &lt;Font size="24.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Label fx:id="userLabel" layoutX="428.0" layoutY="24.0" prefHeight="20.0" prefWidth="162.0"&gt;
           &lt;font&gt;
              &lt;Font name="System Bold" size="14.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
        &lt;Button layoutX="197.0" layoutY="559.0" mnemonicParsing="false" onAction="#handleUpdateButtonAction" prefHeight="25.0" prefWidth="79.0" text="Update Job" /&gt;
        &lt;Label layoutX="20.0" layoutY="90.0" prefHeight="17.0" prefWidth="107.0" text="Press F5 To Refresh" /&gt;
        &lt;Button layoutX="447.0" layoutY="559.0" mnemonicParsing="false" onAction="#handleBackButtonAction" prefHeight="25.0" prefWidth="79.0" text="Back" AnchorPane.bottomAnchor="50.0" AnchorPane.leftAnchor="447.0" AnchorPane.rightAnchor="76.0" AnchorPane.topAnchor="559.0" /&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>
  
  <p>EDIT: I am using an AnchorPane as a layout, added FXML code for clarity.</p>