Javafx components should always be in center of AnchorPane
<p>I want my Javafx Components like Labels, TextFields wrapped in VBoxes separately, to be remain in the center of the window even if it's resized. see attatched Images. Currently these components are contained in an anchorPane. 
FXML file code is given below. Please provide me an idea how to do this. Thanks.</p>

<p><a href="http://i.stack.imgur.com/rhVJt.png" rel="nofollow">Image for small size window where components are in middle.</a></p>

<p><a href="http://i.stack.imgur.com/rokQ9.png" rel="nofollow">Full sized window but component position is not changed. </a></p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;?import javafx.scene.*?&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;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="650.0" minWidth="850.0" prefHeight="650.0" prefWidth="850.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"&gt;
&lt;children&gt;
  &lt;HBox layoutY="-1.0" minWidth="500.0" prefHeight="653.0" prefWidth="850.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"&gt;
     &lt;children&gt;
        &lt;MenuBar layoutY="-1.0" minWidth="500.0" prefHeight="30.0" prefWidth="850.0" HBox.hgrow="ALWAYS"&gt;
          &lt;menus&gt;
            &lt;Menu mnemonicParsing="false" text="Account"&gt;
              &lt;items&gt;
                &lt;MenuItem fx:id="menuItemCreate" mnemonicParsing="false" text="Create" /&gt;
                    &lt;MenuItem fx:id="menuItemUpdate" mnemonicParsing="false" text="Update" /&gt;
                    &lt;MenuItem fx:id="menuItemDelete" mnemonicParsing="false" text="Delete" /&gt;
                    &lt;MenuItem fx:id="menuItemLedger" mnemonicParsing="false" text="Ledger" /&gt;
              &lt;/items&gt;
            &lt;/Menu&gt;
            &lt;Menu mnemonicParsing="false" text="In Stock"&gt;
              &lt;items&gt;
                &lt;MenuItem fx:id="menuItemAddItem" mnemonicParsing="false" text="Add items" /&gt;
                    &lt;MenuItem fx:id="menuItemInventory" mnemonicParsing="false" text="Inventory" /&gt;
              &lt;/items&gt;
            &lt;/Menu&gt;
            &lt;Menu mnemonicParsing="false" text="Reports"&gt;
              &lt;items&gt;
                &lt;MenuItem fx:id="menuItemSalesReport" mnemonicParsing="false" text="Sales report" /&gt;
                    &lt;MenuItem fx:id="menuItemProfitReport" mnemonicParsing="false" text="Profit report" /&gt;
                    &lt;MenuItem fx:id="menuItemRcvables" mnemonicParsing="false" text="Receivables" /&gt;
              &lt;/items&gt;
            &lt;/Menu&gt;
          &lt;/menus&gt;
        &lt;/MenuBar&gt;
     &lt;/children&gt;
  &lt;/HBox&gt;
  &lt;AnchorPane fx:id="anchorPaneUpdate" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false"&gt;
     &lt;children&gt;
        &lt;VBox layoutX="300.0" layoutY="150.0" prefHeight="120.0" prefWidth="60.0" spacing="30.0"&gt;
           &lt;children&gt;
              &lt;Label alignment="BASELINE_RIGHT" prefWidth="60.0" text="Full Name" BorderPane.alignment="CENTER" VBox.vgrow="NEVER" /&gt;
              &lt;Label alignment="BASELINE_RIGHT" layoutX="10.0" layoutY="10.0" prefWidth="60.0" text="Address" VBox.vgrow="NEVER" /&gt;
              &lt;Label alignment="BASELINE_RIGHT" layoutX="10.0" layoutY="27.0" prefWidth="60.0" text="CNIC" VBox.vgrow="NEVER" /&gt;
              &lt;Label alignment="BASELINE_RIGHT" layoutX="10.0" layoutY="44.0" prefWidth="60.0" text="Mobile #" VBox.vgrow="NEVER" /&gt;
           &lt;/children&gt;
        &lt;/VBox&gt;
        &lt;VBox layoutX="400.0" layoutY="150.0" spacing="20.0"&gt;
           &lt;children&gt;
              &lt;TextField layoutX="10.0" layoutY="10.0" promptText="Full name" /&gt;
              &lt;TextField promptText="Full name" VBox.vgrow="NEVER" /&gt;
              &lt;TextField promptText="Current address" VBox.vgrow="NEVER" /&gt;
              &lt;TextField promptText="XXXXX-XXXXXXX-X" VBox.vgrow="NEVER" /&gt;
              &lt;TextField promptText="XXXX-XXXXXXX" VBox.vgrow="NEVER" /&gt;
              &lt;Button mnemonicParsing="false" prefWidth="70.0" text="Create" /&gt;
           &lt;/children&gt;
        &lt;/VBox&gt;
        &lt;Label layoutX="50.0" layoutY="80.0" text="Update a customer account"&gt;
           &lt;font&gt;
              &lt;Font name="Arial Narrow Bold" size="17.0" /&gt;
           &lt;/font&gt;
        &lt;/Label&gt;
     &lt;/children&gt;&lt;/AnchorPane&gt;
  &lt;AnchorPane fx:id="anchorPaneDelete" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPaneLedger" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPaneAddItem" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPaneInventory" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPaneSalesReport" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPaneProfitReport" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;AnchorPane fx:id="anchorPanerRcvable" layoutY="30.0" prefHeight="620.0" prefWidth="850.0" visible="false" /&gt;
  &lt;VBox layoutX="300.0" layoutY="230.0" AnchorPane.bottomAnchor="199.0" AnchorPane.leftAnchor="300.0" AnchorPane.rightAnchor="301.0" AnchorPane.topAnchor="200.0"&gt;
     &lt;children&gt;
        &lt;StackPane fx:id="pane_main" minHeight="200.0" minWidth="200.0" prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"&gt;
           &lt;children&gt;
              &lt;Group&gt;
                 &lt;children&gt;
                    &lt;VBox spacing="10.0"&gt;
                       &lt;children&gt;
                          &lt;HBox prefHeight="30.0" prefWidth="330.0" spacing="30.0"&gt;
                             &lt;children&gt;
                                &lt;Label alignment="BASELINE_RIGHT" prefWidth="80.0" text="Search Name" /&gt;
                                &lt;TextField minWidth="130.0" prefWidth="130.0" promptText="Enter name" /&gt;
                             &lt;/children&gt;
                          &lt;/HBox&gt;
                          &lt;Label alignment="BASELINE_RIGHT" prefWidth="80.0" text="Details:" /&gt;
                          &lt;Separator minWidth="165.0" prefHeight="10.0" prefWidth="330.0" /&gt;
                          &lt;HBox spacing="30.0"&gt;
                             &lt;children&gt;
                                &lt;VBox spacing="30.0"&gt;
                                   &lt;children&gt;
                                      &lt;Label alignment="BASELINE_RIGHT" prefWidth="80.0" text="Full Name" VBox.vgrow="NEVER" /&gt;
                                      &lt;Label alignment="BASELINE_RIGHT" layoutX="10.0" layoutY="10.0" prefWidth="80.0" text="Address" VBox.vgrow="NEVER" /&gt;
                                      &lt;Label alignment="BASELINE_RIGHT" layoutX="10.0" layoutY="10.0" prefWidth="80.0" text="CNIC" VBox.vgrow="NEVER" /&gt;
                                      &lt;Label alignment="BASELINE_RIGHT" layoutX="20.0" layoutY="20.0" prefWidth="80.0" text="Mobile #" VBox.vgrow="NEVER" /&gt;
                                   &lt;/children&gt;
                                &lt;/VBox&gt;
                                &lt;VBox layoutX="100.0" spacing="20.0"&gt;
                                   &lt;children&gt;
                                      &lt;TextField minWidth="130.0" prefWidth="130.0" promptText="Full name" VBox.vgrow="NEVER" /&gt;
                                      &lt;TextField minWidth="130.0" prefWidth="130.0" promptText="Current address" VBox.vgrow="NEVER" /&gt;
                                      &lt;TextField minWidth="130.0" prefWidth="130.0" promptText="XXXXX-XXXXXXX-X" VBox.vgrow="NEVER" /&gt;
                                      &lt;TextField minWidth="130.0" prefWidth="130.0" promptText="XXXX-XXXXXXX" VBox.vgrow="NEVER" /&gt;
                                      &lt;Button minWidth="70.0" mnemonicParsing="false" prefWidth="70.0" text="Create" VBox.vgrow="NEVER" /&gt;
                                   &lt;/children&gt;
                                &lt;/VBox&gt;
                             &lt;/children&gt;
                          &lt;/HBox&gt;
                          &lt;Label text="Update a customer account" VBox.vgrow="NEVER"&gt;
                             &lt;font&gt;
                                &lt;Font name="Arial Narrow Bold" size="17.0" /&gt;
                             &lt;/font&gt;
                          &lt;/Label&gt;
                       &lt;/children&gt;
                    &lt;/VBox&gt;
                 &lt;/children&gt;
              &lt;/Group&gt;
           &lt;/children&gt;
        &lt;/StackPane&gt;
     &lt;/children&gt;
  &lt;/VBox&gt;
  &lt;/children&gt;
  &lt;/AnchorPane&gt;
</code></pre>