JAVAFX FXML Scene not staying within layout constraints or screen resolution - javafx

This is a short two part question: 1. I have designed all the UI for my database in Javafx scene builder 2.0 on a scene size 1920 x 1080; however, I need it to resize based on the screen resolution of the system its operating on. How can this be done?. 2. Second problem which goes hand in hand with the first is all of the controls I have placed in the scene are not staying within the size or location constraints I set. When I preview the scene from the tool everything is correct, but when I run the program everything is out of whack. Any suggestions on what I can do to correct these issues without a complete redesign?
the FXML code:
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ListView?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.SeparatorMenuItem?>
<?import javafx.scene.control.Tab?>
<?import javafx.scene.control.TabPane?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TreeView?>
<?import javafx.scene.effect.InnerShadow?>
<?import javafx.scene.input.KeyCodeCombination?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.Pane?>
<Pane xmlns="http://javafx.com/javafx/8.0.65"xmlns:fx="http://javafx.com/fxml/1" fx:controller="MAAT.MainScreenController">
<children>
<Pane layoutY="-5.0" />
<TabPane fx:id="mainpane" layoutY="35.0" maxHeight="1047.0" maxWidth="1920.0" prefHeight="1047.0" prefWidth="1920.0" side="LEFT" tabClosingPolicy="UNAVAILABLE">
<tabs>
<Tab fx:id="AHTAtab" text="All Hazard Threat Assessment">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="1009.0" prefWidth="1871.0">
<children>
<TableView fx:id="AHTATable" layoutX="23.0" layoutY="56.0" prefHeight="928.0" prefWidth="1840.0">
<columns>
<TableColumn editable="false" prefWidth="132.0" sortable="false" text="Classification" />
<TableColumn minWidth="0.0" prefWidth="95.0" text="T/H/C" />
<TableColumn editable="false" prefWidth="364.0" sortable="false" text="Category & Capability" />
<TableColumn editable="false" prefWidth="1122.0" sortable="false" text="Rating Definition" />
<TableColumn prefWidth="137.0" text="Rating Score" />
</columns>
<effect>
<InnerShadow />
</effect>
</TableView>
<Button fx:id="AHTAedit" layoutX="1718.0" layoutY="994.0" mnemonicParsing="false" text="Edit" />
<Button fx:id="AHTAdel" layoutX="1785.0" layoutY="994.0" mnemonicParsing="false" text="Delete" />
<AnchorPane layoutX="22.0" layoutY="11.0">
<children>
<Button fx:id="Tbtn" mnemonicParsing="false" text="Threat" />
</children>
</AnchorPane>
<AnchorPane layoutX="107.0" layoutY="11.0">
<children>
<Button fx:id="Hbtn" mnemonicParsing="false" text="Hazard" />
</children>
</AnchorPane>
<AnchorPane layoutX="199.0" layoutY="11.0">
<children>
<Button fx:id="Cbtn" mnemonicParsing="false" prefHeight="39.0" prefWidth="79.0" text="Cyber" />
</children>
</AnchorPane>
</children>
</AnchorPane>
</content>
</Tab>
<Tab fx:id="AAtab" text="Asset Analysis">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<TreeView fx:id="AAlist" layoutX="16.0" layoutY="105.0" prefHeight="845.0" prefWidth="583.0">
<effect>
<InnerShadow />
</effect>
</TreeView>
<Label layoutX="16.0" layoutY="14.0" prefHeight="33.0" prefWidth="88.0" text="Asset List: " underline="true" wrapText="true" />
<Button fx:id="Addassetbtn" layoutX="387.0" layoutY="966.0" mnemonicParsing="false" text="Add Assets" />
<Label layoutX="14.0" layoutY="38.0" prefHeight="60.0" prefWidth="587.0" text="Upon selecting the "Add Asset" button and completing the form each asset and its related dependencies will appear below." wrapText="true" />
<Button fx:id="AARemovebtn" layoutX="509.0" layoutY="966.0" mnemonicParsing="false" text="Remove" />
<AnchorPane layoutX="644.0" layoutY="105.0" prefHeight="845.0" prefWidth="1203.0" visible="false">
<children>
<ListView fx:id="Hpairlist" layoutY="645.0" prefHeight="200.0" prefWidth="1203.0">
<effect>
<InnerShadow />
</effect>
</ListView>
<ListView fx:id="Tpairlist" layoutY="402.0" prefHeight="200.0" prefWidth="1203.0">
<effect>
<InnerShadow />
</effect>
</ListView>
<Label layoutY="375.0" text="Paired Threats:" />
<Label layoutY="618.0" text="Paired Hazards:" />
<Separator layoutY="360.0" prefHeight="15.0" prefWidth="1202.0" />
<Label fx:id="AAclassification" alignment="CENTER" layoutX="466.0" layoutY="1.0" prefHeight="27.0" prefWidth="270.0" text="Classification placeholder" textAlignment="CENTER" AnchorPane.bottomAnchor="817.0" AnchorPane.leftAnchor="466.0" AnchorPane.rightAnchor="467.0" AnchorPane.topAnchor="1.0" />
<Label layoutY="70.0" text="Asset Name:" />
<Label layoutX="502.0" layoutY="70.0" text="Unclassified Asset Name:" />
<Label layoutX="999.0" layoutY="70.0" text="Criticality Score:" />
<Label layoutY="111.0" text="Mission:" />
<Label layoutX="1.0" layoutY="225.0" text="Impact Statement:" />
<TextArea fx:id="Amission" editable="false" layoutX="1.0" layoutY="138.0" prefHeight="87.0" prefWidth="1202.0" wrapText="true">
</TextArea>
<TextArea fx:id="Aimpact" layoutY="252.0" prefHeight="99.0" prefWidth="1202.0" />
<Label fx:id="Aname" layoutX="102.0" layoutY="70.0" prefHeight="27.0" prefWidth="393.0" />
<Label fx:id="UAname" layoutX="707.0" layoutY="70.0" prefHeight="27.0" prefWidth="283.0" />
<Label fx:id="Crit" layoutX="1132.0" layoutY="70.0" prefHeight="27.0" prefWidth="65.0" />
</children>
</AnchorPane>
<Separator layoutX="621.0" layoutY="105.0" orientation="VERTICAL" prefHeight="846.0" prefWidth="6.0" />
</children>
</AnchorPane>
</content>
</Tab>
<Tab fx:id="RATtab" text="Risk Analysis Tool">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
<children>
<TableView fx:id="RATtable" layoutX="14.0" layoutY="83.0" prefHeight="902.0" prefWidth="1842.0">
<columns>
<TableColumn editable="false" prefWidth="216.0" text="Threat/Hazard" />
<TableColumn editable="false" minWidth="0.0" prefWidth="313.0" text="Critical Asset" />
<TableColumn editable="false" minWidth="0.0" prefWidth="480.0" sortable="false" text="Observation" />
<TableColumn editable="false" prefWidth="120.0" sortable="false" text="Vul. " />
<TableColumn editable="false" prefWidth="135.0" text="Int. Risk " />
<TableColumn editable="false" prefWidth="370.0" sortable="false" text="Recommendation" />
<TableColumn editable="false" prefWidth="112.0" sortable="false" text="R. Vul" />
<TableColumn editable="false" prefWidth="93.0" text="R. Risk" />
</columns>
<effect>
<InnerShadow />
</effect>
</TableView>
<Button fx:id="Obbtn" layoutX="14.0" layoutY="37.0" mnemonicParsing="false" text="Observation" />
<Button fx:id="RATed" layoutX="1713.0" layoutY="994.0" mnemonicParsing="false" text="Edit" />
<Button fx:id="RATdel" layoutX="1780.0" layoutY="994.0" mnemonicParsing="false" text="Delete" />
<Button fx:id="CRbtn" layoutX="148.0" layoutY="37.0" mnemonicParsing="false" text="Cumulative Risk" />
</children>
</AnchorPane>
</content>
</Tab>
</tabs>
</TabPane>
<MenuBar fx:id="MMBar" layoutX="-6.0" layoutY="-5.0" prefHeight="39.0" prefWidth="1927.0">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="New">
<accelerator>
<KeyCodeCombination alt="UP" code="N" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Open" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Save">
<accelerator>
<KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Save As...">
<accelerator>
<KeyCodeCombination alt="UP" code="S" control="DOWN" meta="UP" shift="DOWN" shortcut="UP" />
</accelerator>
</MenuItem>
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Import" />
<MenuItem mnemonicParsing="false" text="Export" />
<SeparatorMenuItem mnemonicParsing="false" />
<MenuItem mnemonicParsing="false" text="Close Window">
<accelerator>
<KeyCodeCombination alt="UP" code="W" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
<MenuItem mnemonicParsing="false" text="Quit">
<accelerator>
<KeyCodeCombination alt="UP" code="Q" control="DOWN" meta="UP" shift="UP" shortcut="UP" />
</accelerator>
</MenuItem>
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</children>
</Pane>

Related

Javafx FXML - How to make GridPane the same height as the window?

The intended outcome is that the element at (0,0) should resize to fill up the empty space around the GridPane. I have looked at other questions similar to this and the answers have not worked - I am trying to make the GridPane the same height as the VBox that is inside of. It works horizontally using hrow="always", but using vgrow="always" has not had the same affect.
I have coloured the VBox that the GridPane is within a different colour, so it is clear that the VBox is taking up the height of the stage, and therefore the GridPane is the issue here. How could I stretch the vertical height similar to the horizontal width?
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.*?>
<?import javafx.scene.SubScene?>
<?import javafx.scene.Group?>
<VBox
fx:controller="Controller"
xmlns:fx="http://javafx.com/fxml"
styleClass="root" >
<MenuBar>
<menus>
<Menu text="File">
<items>
<MenuItem text="New" />
<MenuItem text="Save" />
<MenuItem text="Load" />
</items>
</Menu>
</menus>
</MenuBar>
<GridPane hgap="10" vgap="10">
<rowConstraints>
<RowConstraints vgrow="ALWAYS" />
</rowConstraints>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<gridLinesVisible>true</gridLinesVisible>
<SubScene
GridPane.columnIndex="0" GridPane.rowIndex="0"
GridPane.rowSpan="6">
<root>
<Group />
</root>
</SubScene>
<Button text="Add"
GridPane.columnIndex="1" GridPane.rowIndex="0" />
<Button text="Edit"
GridPane.columnIndex="2" GridPane.rowIndex="0" />
<Button text="Delete"
GridPane.columnIndex="3" GridPane.rowIndex="0" />
<ScrollPane
GridPane.columnIndex="1" GridPane.rowIndex="1"
GridPane.columnSpan="3" />
<Label text="Speed"
GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Slider
GridPane.columnIndex="2" GridPane.rowIndex="2"
GridPane.columnSpan="2" />
<Label text="Gravity"
GridPane.columnIndex="1" GridPane.rowIndex="3" />
<TextField
GridPane.columnIndex="2" GridPane.rowIndex="3"
GridPane.columnSpan="2" />
<HBox
GridPane.columnIndex="1" GridPane.rowIndex="4">
<Button text="<<" />
<Button text="<" />
</HBox>
<Text text="0.00"
GridPane.columnIndex="2" GridPane.rowIndex="4" />
<HBox
GridPane.columnIndex="3" GridPane.rowIndex="4">
<Button text=">" />
<Button text=">>" />
</HBox>
<Button text="Start"
GridPane.columnIndex="2" GridPane.rowIndex="5" />
</GridPane>
<stylesheets>
<URL value="#style.css" />
</stylesheets>
</VBox>

JavaFX resizable layout(scene builder)

I have a AnchorPane with some elements as you can see:
Sample.fxml
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.Group?>
<?import javafx.scene.chart.LineChart?>
<?import javafx.scene.chart.NumberAxis?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TableColumn?>
<?import javafx.scene.control.TableView?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500.0" prefWidth="800.0" style="-fx-background-color: #fff;" xmlns="http://javafx.com/javafx/9.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sample.Controller">
<AnchorPane prefHeight="500.0" prefWidth="800.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<MenuBar prefHeight="30.0" prefWidth="800.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<Menu mnemonicParsing="false" text="File">
<MenuItem mnemonicParsing="false" text="Close" />
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<MenuItem mnemonicParsing="false" text="Delete" />
</Menu>
<Menu mnemonicParsing="false" text="Help">
<MenuItem mnemonicParsing="false" text="About" />
</Menu>
</MenuBar>
<Group />
<TableView id="tableDisplay" fx:id="tableDisplay" editable="true" layoutX="14.0" layoutY="50.0" prefHeight="200.0" prefWidth="771.0" AnchorPane.bottomAnchor="250.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.799999999999955" AnchorPane.topAnchor="50.0">
<columns>
<TableColumn id="tableWellN" fx:id="tableWellN" prefWidth="75.20001220703125" text="Колодязь №" />
<TableColumn id="tableWellD" fx:id="tableWellD" editable="false" prefWidth="66.39996337890625" text="D колодязя" />
<TableColumn id="tableMarkB" fx:id="tableMarkB" minWidth="9.5999755859375" prefWidth="79.199951171875" text="Відмітка низу труби" />
<TableColumn id="tableMarkP" fx:id="tableMarkP" minWidth="0.800048828125" prefWidth="114.4000244140625" text="Проектна відмітка землі" />
<TableColumn id="tableMarkN" fx:id="tableMarkN" minWidth="0.0" prefWidth="139.99993896484375" text="Натуральна відмітка землі" />
<TableColumn id="tableDiameter" fx:id="tableDiameter" prefWidth="64.800048828125" text="Діаметер" />
<TableColumn id="tableLength" fx:id="tableLength" prefWidth="75.0" text="Довжина" />
<TableColumn id="tableSlope" fx:id="tableSlope" prefWidth="68.00006103515625" text="Похил" />
<TableColumn id="tablePipeB" fx:id="tablePipeB" prefWidth="46.4000244140625" text="Низ труби">
<columns>
<TableColumn id="tablePipeS" fx:id="tablePipeS" prefWidth="75.0" text="Початок" />
<TableColumn id="tablePipeE" fx:id="tablePipeE" prefWidth="75.0" text="Кінець" />
</columns>
</TableColumn>
<TableColumn id="tablePipeT" fx:id="tablePipeT" prefWidth="61.5999755859375" text="Верх труби">
<columns>
<TableColumn fx:id="tablePipeTS" prefWidth="75.0" text="Початок" />
<TableColumn fx:id="tablePipeTE" prefWidth="75.0" text="Кінець" />
</columns>
</TableColumn>
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<TextField id="inputWellN" fx:id="inputWellN" layoutX="14.0" layoutY="278.0" promptText="Колодязь №" AnchorPane.bottomAnchor="196.4" AnchorPane.leftAnchor="14.0" />
<TextField id="inputWellD" fx:id="inputWellD" layoutX="14.0" layoutY="319.0" promptText="Діаметер колодязя" AnchorPane.bottomAnchor="155.39999999999998" AnchorPane.leftAnchor="14.0" />
<TextField id="inputMarkB" fx:id="inputMarkB" layoutX="14.0" layoutY="357.0" promptText="Відмітка низу" AnchorPane.bottomAnchor="117.39999999999998" AnchorPane.leftAnchor="14.0" />
<TextField id="inputMarkP" fx:id="inputMarkP" layoutX="14.0" layoutY="395.0" promptText="Проектна відмітка" AnchorPane.bottomAnchor="79.39999999999998" AnchorPane.leftAnchor="14.0" />
<TextField id="inputMarkN" fx:id="inputMarkN" layoutX="14.0" layoutY="438.0" promptText="Натуральна відмітка" AnchorPane.bottomAnchor="36.39999999999998" AnchorPane.leftAnchor="14.0" />
<TextField id="inputDiameter" fx:id="inputDiameter" layoutX="171.0" layoutY="278.0" promptText="Діаметер" AnchorPane.bottomAnchor="196.4" AnchorPane.leftAnchor="171.0" />
<TextField id="inputLength" fx:id="inputLength" layoutX="170.0" layoutY="319.0" promptText="Довжина" AnchorPane.bottomAnchor="155.39999999999998" AnchorPane.leftAnchor="170.0" />
<TextField id="inputSlope" fx:id="inputSlope" layoutX="170.0" layoutY="357.0" promptText="Похил" AnchorPane.bottomAnchor="117.4" AnchorPane.leftAnchor="170.0" />
<Button fx:id="buttonAdd" layoutX="170.0" layoutY="395.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="149.0" text="Добавити" AnchorPane.bottomAnchor="78.6" AnchorPane.leftAnchor="170.0" />
<Button fx:id="buttonBuild" layoutX="169.0" layoutY="438.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="150.0" text="Побудувати" AnchorPane.bottomAnchor="35.60000000000002" AnchorPane.leftAnchor="169.0" />
<LineChart fx:id="chartArea" layoutX="376.0" layoutY="300.0" prefHeight="178.0" prefWidth="402.0" AnchorPane.bottomAnchor="21.599999999999994" AnchorPane.leftAnchor="376.0" AnchorPane.rightAnchor="21.600000000000023" AnchorPane.topAnchor="300.0">
<xAxis>
<NumberAxis fx:id="lineChartX" side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis fx:id="lineChartY" autoRanging="false" side="LEFT" tickUnit="0.1" />
</yAxis>
</LineChart>
</children>
</AnchorPane>
</AnchorPane>
What i need is that when i go full screen only the buttons and text fields remain the same and the rest get bigger. I tried setting the anchors and it almost as i want it, but when i resize the window the table and line chart overlap:
How can i fix this?
I would not lay it out like you have done. Positioning in JavaFX takes a bit to master. Have you read/understood this?
https://docs.oracle.com/javase/8/javafx/layout-tutorial/index.html
Use Screenbuilder to get started, then customize it in your IDE. Screenbuilder uses absolute positioning. You may need to convert/wrap some sections with HBox, VBox, TilePane etc. to get the layout you want. It may take a few tries. Good Luck!

JavaFX Loader not loading

This is my Main Class:
public class Main extends Application {
#Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("mainmenu.fxml"));
primaryStage.setTitle("Horse Manager");
primaryStage.setScene(new Scene(root,400,600));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
}
And I am getting this error:
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:745)
Caused by: javafx.fxml.LoadException:
/C:/Users/nikit/IdeaProjects/SEPM/out/production/SEPM/sepm/ss17/e1526589/GUI/XMLs/mainmenu.fxml:42
and this is the fxml made with SceneBuilder:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Accordion?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Menu?>
<?import javafx.scene.control.MenuBar?>
<?import javafx.scene.control.MenuItem?>
<?import javafx.scene.control.TitledPane?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<BorderPane fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="500" minWidth="500" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sepm.ss17.e1526589.GUI.XMLs.Controllers.MainMenuController">
<top>
<MenuBar BorderPane.alignment="CENTER">
<menus>
<Menu mnemonicParsing="false" text="File">
<items>
<MenuItem mnemonicParsing="false" text="Close" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Edit">
<items>
<MenuItem mnemonicParsing="false" text="Delete" />
</items>
</Menu>
<Menu mnemonicParsing="false" text="Help">
<items>
<MenuItem mnemonicParsing="false" text="About" />
</items>
</Menu>
</menus>
</MenuBar>
</top>
<left>
<Accordion BorderPane.alignment="CENTER">
<panes>
<TitledPane prefHeight="200.0" prefWidth="200.0" text="Boxes">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="boxSearch" mnemonicParsing="false" prefWidth="250.0" text="Search" />
<Button fx:id="boxCD" mnemonicParsing="false" prefWidth="250.0" text="Create/Delete Box" />
<Button fx:id="boxUpdate" mnemonicParsing="false" prefWidth="250.0" text="Update Box" />
</children>
</VBox>
</content>
</TitledPane>
<TitledPane animated="false" text="Customers">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="customerSearch" mnemonicParsing="false" prefWidth="250.0" text="Search" />
<Button fx:id="customerCD" mnemonicParsing="false" prefWidth="250.0" text="Customer New/Old" />
<Button fx:id="customerUpdate" mnemonicParsing="false" prefWidth="250.0" text="Update Cutomer" />
</children>
</VBox>
</content>
</TitledPane>
<TitledPane animated="false" text="Reservations">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="reservationsSearch" mnemonicParsing="false" prefWidth="250.0" text="Search" />
<Button fx:id="reservationsCD" mnemonicParsing="false" prefWidth="250.0" text="Create/Delete Reservations" />
<Button fx:id="reservationsUpdate" mnemonicParsing="false" prefWidth="250.0" text="Update Reservations" />
</children>
</VBox>
</content>
</TitledPane>
<TitledPane prefHeight="200.0" prefWidth="200.0" text="Bills">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button fx:id="billsSearch" mnemonicParsing="false" prefWidth="250.0" text="Search" />
<Button fx:id="billsCD" mnemonicParsing="false" prefWidth="250.0" text="Create/Delete Bills" />
<Button fx:id="billsUpdate" mnemonicParsing="false" prefWidth="250.0" text="Update Bills" />
</children>
</VBox>
</content>
</TitledPane>
<TitledPane prefHeight="200.0" prefWidth="200.0" text="Statistics">
<content>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<Button mnemonicParsing="false" prefWidth="250.0" text="Search" />
<Button mnemonicParsing="false" prefWidth="250.0" text="Create/Delete Box" />
<Button mnemonicParsing="false" prefWidth="250.0" text="Update Box" />
</children>
</VBox>
</content>
</TitledPane>
</panes>
</Accordion>
</left>
<center>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Welcome to Horse Manager" BorderPane.alignment="CENTER" />
</center>
</BorderPane>
my path works and I dont know what else could be wrong the error happens because of the .load function from what I can tell. Please Help

make anchorpane resizable with size of screen

How to bind an AnchorPane to the size of the screen?
When I run my code it shows me that:
but when the main stage fit the screen the AnchorPane still has the same size.
here is my fxml file
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="768.0" prefWidth="1024.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sanad.Entry_Page">
<children>
<Pane blendMode="RED" layoutX="563.0" layoutY="9.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" prefHeight="746.0" prefWidth="447.0">
<padding>
<Insets top="10.0" />
</padding>
<children>
<SplitPane dividerPositions="0.5720620842572062" layoutX="-56.0" layoutY="-1.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="508.0">
<items>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="751.0" prefWidth="286.0">
<children>
<TextField fx:id="formnumer_field" layoutX="8.0" layoutY="14.0" prefHeight="30.0" prefWidth="235.0" />
<TextField fx:id="sectornumber_field" layoutX="8.0" layoutY="48.0" prefHeight="30.0" prefWidth="235.0" />
<TextField fx:id="fathername_field" layoutX="8.0" layoutY="82.0" prefHeight="30.0" prefWidth="235.0" />
<ComboBox fx:id="fatherborn_year" layoutX="8.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" />
<ComboBox fx:id="fatherborn_month" layoutX="85.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" />
<ComboBox fx:id="fatherborn_day" layoutX="162.0" layoutY="116.0" prefHeight="25.0" prefWidth="80.0" />
<TextField fx:id="fathercurrentjob" layoutX="8.0" layoutY="145.0" prefHeight="30.0" prefWidth="235.0" />
<TextField fx:id="fatherprevjob" layoutX="8.0" layoutY="179.0" prefHeight="30.0" prefWidth="235.0" />
<TextField fx:id="mothername_field" layoutX="8.0" layoutY="215.0" prefHeight="30.0" prefWidth="235.0" />
<TextField fx:id="mother_curr_job" layoutX="8.0" layoutY="278.0" prefHeight="30.0" prefWidth="235.0" />
<ComboBox fx:id="motherborn_day" layoutX="162.0" layoutY="249.0" prefHeight="25.0" prefWidth="80.0" />
<ComboBox fx:id="motherborn_year" layoutX="8.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" />
<TextField fx:id="mother_prev_job" layoutX="8.0" layoutY="312.0" prefHeight="30.0" prefWidth="235.0" />
<ComboBox fx:id="motherborn_month" layoutX="85.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" />
<TextField fx:id="homepartner_num" layoutX="8.0" layoutY="346.0" prefHeight="30.0" prefWidth="235.0" />
<ComboBox fx:id="homepartner_year" layoutX="11.0" layoutY="382.0" prefHeight="25.0" prefWidth="70.0" />
<ComboBox fx:id="homepartner_month" layoutX="88.0" layoutY="382.0" prefHeight="25.0" prefWidth="70.0" />
<ComboBox fx:id="homepartner_day" layoutX="163.0" layoutY="382.0" prefHeight="25.0" prefWidth="80.0" />
<ComboBox fx:id="homepartner_name" layoutX="8.0" layoutY="416.0" prefHeight="30.0" prefWidth="235.0" />
<CheckBox fx:id="homepartner_gender1" layoutX="141.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="ذكر">
<font>
<Font size="14.0" />
</font>
</CheckBox>
<CheckBox fx:id="homepartner_gender2" layoutX="8.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="أنثى">
<font>
<Font size="14.0" />
</font>
</CheckBox>
<Label fx:id="current_cityaa" alignment="CENTER" layoutX="141.0" layoutY="490.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="current_city" layoutX="8.0" layoutY="490.0" prefHeight="30.0" prefWidth="120.0" />
<Label fx:id="current_cityaa1" alignment="CENTER" layoutX="141.0" layoutY="530.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="current_suberb" layoutX="8.0" layoutY="530.0" prefHeight="30.0" prefWidth="120.0" />
<TextField fx:id="prev_suberb" layoutX="11.0" layoutY="615.0" prefHeight="30.0" prefWidth="120.0" />
<Label fx:id="current_cityaa11" alignment="CENTER" layoutX="144.0" layoutY="615.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي">
<font>
<Font size="14.0" />
</font>
</Label>
<Label fx:id="current_cityaa2" alignment="CENTER" layoutX="144.0" layoutY="575.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="prev_city" layoutX="11.0" layoutY="575.0" prefHeight="30.0" prefWidth="120.0" />
</children>
</AnchorPane>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<Label fx:id="formnumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="14.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم الاستمارة" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<padding>
<Insets left="50.0" />
</padding>
<font>
<Font size="14.0" />
</font>
</Label>
<Label fx:id="sectornumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="48.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم القطاع" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fathername" contentDisplay="RIGHT" layoutX="8.0" layoutY="82.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأب" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fatherborn" contentDisplay="RIGHT" layoutX="20.0" layoutY="112.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="currentjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="142.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="previousjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="172.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fatherborn1" contentDisplay="RIGHT" layoutX="20.0" layoutY="244.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="currentjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="278.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fathername1" contentDisplay="RIGHT" layoutX="8.0" layoutY="208.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="previousjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="307.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="homepartner_sex" contentDisplay="RIGHT" layoutX="20.0" layoutY="451.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الجنس" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="homepartner_name" contentDisplay="RIGHT" layoutX="20.0" layoutY="414.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الاسم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="partner_born" contentDisplay="RIGHT" layoutX="20.0" layoutY="378.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الميلاد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="home_partner" contentDisplay="RIGHT" layoutX="8.0" layoutY="341.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="عدد المستضافين" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label alignment="CENTER" layoutX="8.0" layoutY="485.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي">
<font>
<Font size="14.0" />
</font>
</Label>
<Label alignment="CENTER" layoutX="8.0" layoutY="570.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي">
<font>
<Font size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
</Pane>
<SplitPane dividerPositions="0.4845360824742268" layoutX="8.0" layoutY="8.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="487.0">
<items>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" />
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="100.0" />
</items>
</SplitPane>
</children>
</AnchorPane>
This can be done using this property of AnchorPane:
AnchorPane.bottomAnchor
AnchorPane.leftAnchor
AnchorPane.rightAnchor
AnchorPane.topAnchor
But you need to decide what part of a scene will change and what is not. The width of the fixed part fix with prefWidth. Сhanging part fix with AnchorPane.leftAnchor or AnchorPane.rightAnchor given the size of the fixed part.
Sample:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.chart.*?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="600.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="sanad.Entry_Page">
<children>
<Accordion prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="0.0">
<panes>
<TitledPane animated="false" text="untitled 1">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</TitledPane>
<TitledPane animated="false" text="untitled 2">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</TitledPane>
<TitledPane animated="false" text="untitled 3">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0" />
</content>
</TitledPane>
</panes>
</Accordion>
<SplitPane dividerPositions="0.5" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="200.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<items>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<LineChart AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<xAxis>
<CategoryAxis side="BOTTOM" />
</xAxis>
<yAxis>
<NumberAxis side="LEFT" />
</yAxis>
</LineChart>
</children>
</AnchorPane>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<TableView prefHeight="200.0" prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<columns>
<TableColumn prefWidth="75.0" text="C1" />
<TableColumn prefWidth="75.0" text="C2" />
</columns>
</TableView>
</children>
</AnchorPane>
</items>
</SplitPane>
</children>
</AnchorPane>
I try do something with this fxml, but i think that is bad created. You should rebuild everything. For right site is better to use GridPane not AnchorPane and put all elements in grid.
I created HBox in this hobx I put two AnchorPane, then each AnchorPane i put Your SplitPane. After this you must connect each SplitPane with right and left edge of AnchorPane like this:
<SplitPane AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
Here is this fxml:
Use SceneBuilder to preview how it works.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.text.*?>
<?import javafx.geometry.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<HBox id="AnchorPane" prefHeight="786.0" prefWidth="1024.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
<AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<children>
<SplitPane dividerPositions="0.4845360824742268" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="487.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<items>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0" />
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="327.0" prefWidth="100.0" />
</items>
</SplitPane>
</children>
</AnchorPane>
<AnchorPane prefHeight="200.0" prefWidth="200.0" HBox.hgrow="ALWAYS">
<children>
<SplitPane dividerPositions="0.5720620842572062" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="741.0" prefWidth="508.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<items>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" nodeOrientation="LEFT_TO_RIGHT">
<children>
<TextField fx:id="formnumer_field" layoutX="8.0" layoutY="14.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" />
<TextField fx:id="sectornumber_field" layoutX="8.0" layoutY="48.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" />
<TextField fx:id="fathername_field" layoutX="8.0" layoutY="82.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="43.0" />
<ComboBox fx:id="fatherborn_year" layoutX="8.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" />
<ComboBox fx:id="fatherborn_month" layoutX="85.0" layoutY="116.0" prefHeight="25.0" prefWidth="70.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" />
<ComboBox fx:id="fatherborn_day" layoutX="162.0" layoutY="116.0" prefHeight="25.0" prefWidth="80.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="226.0" />
<TextField fx:id="fathercurrentjob" layoutX="8.0" layoutY="145.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<TextField fx:id="fatherprevjob" layoutX="8.0" layoutY="179.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<TextField fx:id="mothername_field" layoutX="8.0" layoutY="215.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<TextField fx:id="mother_curr_job" layoutX="8.0" layoutY="278.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<ComboBox fx:id="motherborn_day" layoutX="162.0" layoutY="249.0" prefHeight="25.0" prefWidth="80.0" AnchorPane.rightAnchor="73.0" />
<ComboBox fx:id="motherborn_year" layoutX="8.0" layoutY="249.0" prefHeight="25.0" prefWidth="70.0" />
<TextField fx:id="mother_prev_job" layoutX="8.0" layoutY="312.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<ComboBox fx:id="motherborn_month" layoutX="85.0" layoutY="249.0" nodeOrientation="LEFT_TO_RIGHT" />
<TextField fx:id="homepartner_num" layoutX="8.0" layoutY="346.0" prefHeight="30.0" prefWidth="235.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<ComboBox fx:id="homepartner_year" layoutX="11.0" layoutY="382.0" />
<ComboBox fx:id="homepartner_month" layoutX="88.0" layoutY="382.0" />
<ComboBox fx:id="homepartner_day" layoutX="163.0" layoutY="382.0" />
<ComboBox fx:id="homepartner_name" layoutX="8.0" layoutY="416.0" AnchorPane.leftAnchor="8.0" AnchorPane.rightAnchor="72.0" />
<CheckBox fx:id="homepartner_gender1" layoutX="141.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="ذكر">
<font>
<Font size="14.0" />
</font>
</CheckBox>
<CheckBox fx:id="homepartner_gender2" layoutX="8.0" layoutY="456.0" mnemonicParsing="false" prefHeight="30.0" prefWidth="100.0" text="أنثى">
<font>
<Font size="14.0" />
</font>
</CheckBox>
<Label fx:id="current_cityaa" alignment="CENTER" layoutX="141.0" layoutY="490.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة" AnchorPane.rightAnchor="74.0">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="current_city" layoutX="8.0" layoutY="490.0" AnchorPane.leftAnchor="8.0" />
<Label fx:id="current_cityaa1" alignment="CENTER" layoutX="141.0" layoutY="530.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي" AnchorPane.rightAnchor="74.0">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="current_suberb" layoutX="8.0" layoutY="530.0" AnchorPane.leftAnchor="8.0" />
<TextField fx:id="prev_suberb" layoutX="11.0" layoutY="615.0" AnchorPane.leftAnchor="11.0" />
<Label fx:id="current_cityaa11" alignment="CENTER" layoutX="144.0" layoutY="615.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="الحي" AnchorPane.rightAnchor="71.0">
<font>
<Font size="14.0" />
</font>
</Label>
<Label fx:id="current_cityaa2" alignment="CENTER" layoutX="144.0" layoutY="575.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="100.0" text="المحافظة" AnchorPane.rightAnchor="71.0">
<font>
<Font size="14.0" />
</font>
</Label>
<TextField fx:id="prev_city" layoutX="11.0" layoutY="575.0" AnchorPane.leftAnchor="11.0" />
</children>
</AnchorPane>
<AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="0.0" minWidth="0.0" prefHeight="160.0" prefWidth="100.0">
<children>
<Label fx:id="formnumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="14.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم الاستمارة" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<padding>
<Insets left="50.0" />
</padding>
<font>
<Font size="14.0" />
</font>
</Label>
<Label fx:id="sectornumber" contentDisplay="RIGHT" layoutX="8.0" layoutY="48.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="رقم القطاع" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fathername" contentDisplay="RIGHT" layoutX="8.0" layoutY="82.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأب" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fatherborn" contentDisplay="RIGHT" layoutX="20.0" layoutY="112.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="currentjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="142.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="previousjob" contentDisplay="RIGHT" layoutX="20.0" layoutY="172.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fatherborn1" contentDisplay="RIGHT" layoutX="20.0" layoutY="244.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="المواليد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="currentjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="278.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل الحالي" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="fathername1" contentDisplay="RIGHT" layoutX="8.0" layoutY="208.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="اسم الأم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="previousjob1" contentDisplay="RIGHT" layoutX="20.0" layoutY="307.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="العمل السابق" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="homepartner_sex" contentDisplay="RIGHT" layoutX="20.0" layoutY="451.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الجنس" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="homepartner_name" contentDisplay="RIGHT" layoutX="20.0" layoutY="414.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الاسم" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="partner_born" contentDisplay="RIGHT" layoutX="20.0" layoutY="378.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="127.0" text="الميلاد" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label fx:id="home_partner" contentDisplay="RIGHT" layoutX="8.0" layoutY="341.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="174.0" text="عدد المستضافين" textAlignment="RIGHT" textOverrun="CENTER_ELLIPSIS">
<font>
<Font size="14.0" />
</font>
<padding>
<Insets left="50.0" />
</padding>
</Label>
<Label alignment="CENTER" layoutX="8.0" layoutY="485.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي">
<font>
<Font size="14.0" />
</font>
</Label>
<Label alignment="CENTER" layoutX="8.0" layoutY="570.0" nodeOrientation="RIGHT_TO_LEFT" prefHeight="30.0" prefWidth="175.0" text="السكن الحالي">
<font>
<Font size="14.0" />
</font>
</Label>
</children>
</AnchorPane>
</items>
</SplitPane>
<Pane blendMode="RED" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minWidth="-Infinity" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<padding>
<Insets top="10.0" />
</padding>
</Pane>
</children>
</AnchorPane>
</HBox>

How to make a Table resizable in JavaFX?

In my UI, there is a webView and below that is a table to record some actions in the webView. They are placed one below the other. I want the table below to be resizable. The table is fixed to left, right and below borders. User should be able to drag it up. Just like the inspect element opens up a window below the browser and user can drag it up to view more content.
How can I do this in JavaFX? Please help.
Update:
I tried the below:
HBox.setHgrow(table, Priority.ALWAYS);
VBox.setVgrow(table, Priority.ALWAYS);
None of them had any effects. In scenebuilder, I'm binding the table to bottom, left and right borders.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.web.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<AnchorPane prefHeight="400.0" prefWidth="720.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.controller.RecordController">
<children>
<WebView fx:id="webView" layoutX="80.0" layoutY="48.0" prefHeight="204.0" prefWidth="720.0" AnchorPane.bottomAnchor="156.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="40.0" />
<TableView fx:id="table" editable="true" layoutY="244.0" prefHeight="156.0" prefWidth="626.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0">
<columns>
<TableColumn fx:id="stepDescription" prefWidth="152.0" sortable="false" text="STEP DESCRIPTION" />
<TableColumn fx:id="stepType" prefWidth="85.0" sortable="false" text="STEP TYPE" />
<TableColumn fx:id="pageName" prefWidth="86.0" sortable="false" text="PAGE NAME" />
<TableColumn fx:id="objectName" prefWidth="102.0" sortable="false" text="OBJECT NAME" />
<TableColumn fx:id="actionName" prefWidth="108.0" sortable="false" text="ACTION NAME" />
<TableColumn fx:id="testData" prefWidth="109.0" sortable="false" text="TEST DATA" />
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
</TableView>
<GridPane prefHeight="42.0" prefWidth="579.0">
<children>
<Button fx:id="go" layoutX="261.0" layoutY="20.0" mnemonicParsing="false" prefHeight="32.0" text="Go" AnchorPane.topAnchor="20.0" GridPane.columnIndex="2" />
<TextField fx:id="url" layoutX="97.0" layoutY="20.0" prefHeight="32.0" AnchorPane.topAnchor="20.0" GridPane.columnIndex="1" />
<Label layoutX="56.0" layoutY="24.0" prefHeight="32.0" text="URL" AnchorPane.topAnchor="24.0" GridPane.halignment="RIGHT">
<GridPane.margin>
<Insets right="5.0" />
</GridPane.margin>
</Label>
</children>
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="101.0" minWidth="0.0" prefWidth="46.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="515.0" minWidth="10.0" prefWidth="483.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="177.0" minWidth="10.0" prefWidth="50.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
</GridPane>
<Button fx:id="saveButton" layoutX="663.0" layoutY="5.0" mnemonicParsing="false" onAction="#save" prefHeight="32.0" prefWidth="32.0" AnchorPane.rightAnchor="15.0" />
<Button fx:id="clear" layoutX="634.0" layoutY="5.0" mnemonicParsing="false" onAction="#clear" prefHeight="32.0" prefWidth="32.0" AnchorPane.rightAnchor="55.0" />
<ProgressIndicator fx:id="progress" layoutX="565.0" layoutY="1.0" progress="0.0">
<padding>
<Insets top="10.0" />
</padding>
</ProgressIndicator>
</children>
</AnchorPane>

Resources