title: How to make JavaFX components adjustable with screen size
body: <p>Here is a screenshot of original view of an interface built in JavaFX. Those buttons at the bottom look alright in this screen size.
  <a href="https://i.stack.imgur.com/SQwrU.png" rel="nofollow noreferrer">Original size window</a></p>
  
  <p>And this is the view when the window is set to fullscreen. Those buttons don't grow with the increase in screen size. They look so tiny in comparison to the whole window.</p>
  
  <p><a href="https://i.stack.imgur.com/YzM17.png" rel="nofollow noreferrer">Fullscreen window</a></p>
  
  <p>These buttons are JFXButtons imported from JFoenix library and are wrapped in inside a HBox.I have set VGrow option to always but there is no HGrow option for buttons. I am using Scene Builder from developing this GUI. So how can i make these buttons adjust their size (especially width) with change in screen size.
  Here is .fxml of the interface.</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.geometry.*?&gt;
  &lt;?import com.jfoenix.controls.*?&gt;
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  &lt;?import javafx.scene.layout.AnchorPane?&gt;
  
  &lt;BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="600.0" prefWidth="1000.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="application.MainController"&gt;
      &lt;top&gt;
          &lt;MenuBar BorderPane.alignment="CENTER"&gt;
              &lt;menus&gt;
                  &lt;Menu mnemonicParsing="false" text="File"&gt;
                      &lt;items&gt;
                          &lt;MenuItem mnemonicParsing="false" text="Close" /&gt;
                      &lt;/items&gt;
                  &lt;/Menu&gt;
                  &lt;Menu mnemonicParsing="false" text="Edit"&gt;
                      &lt;items&gt;
                          &lt;MenuItem mnemonicParsing="false" text="Delete" /&gt;
                      &lt;/items&gt;
                  &lt;/Menu&gt;
                  &lt;Menu mnemonicParsing="false" text="Help"&gt;
                      &lt;items&gt;
                          &lt;MenuItem mnemonicParsing="false" text="About" /&gt;
                      &lt;/items&gt;
                  &lt;/Menu&gt;
              &lt;/menus&gt;
          &lt;/MenuBar&gt;
      &lt;/top&gt;
      &lt;bottom&gt;
          &lt;VBox prefHeight="90.0" prefWidth="1000.0" spacing="5.0"&gt;
              &lt;children&gt;
                  &lt;HBox alignment="CENTER" prefHeight="40.0" prefWidth="200.0" spacing="10.0" stylesheets="@../../bin/application/style1.css" BorderPane.alignment="CENTER" VBox.vgrow="ALWAYS"&gt;
                      &lt;children&gt;
                          &lt;JFXButton fx:id="playpauseBtn" buttonType="RAISED" layoutX="310.0" layoutY="18.0" HBox.hgrow="ALWAYS" /&gt;
                    &lt;JFXButton fx:id="playpauseBtn1" buttonType="RAISED" layoutX="485.0" layoutY="17.0" /&gt;
                    &lt;JFXButton fx:id="playpauseBtn11" buttonType="RAISED" layoutX="515.0" layoutY="17.0" /&gt;
                    &lt;JFXButton fx:id="playpauseBtn12" buttonType="RAISED" layoutX="485.0" layoutY="17.0" /&gt;
                    &lt;JFXButton fx:id="playpauseBtn111" buttonType="RAISED" layoutX="515.0" layoutY="17.0" /&gt;
                      &lt;/children&gt;
                  &lt;/HBox&gt;
                  &lt;JFXSlider prefHeight="21.0" prefWidth="1000.0" VBox.vgrow="ALWAYS"&gt;
                 &lt;padding&gt;
                    &lt;Insets bottom="8.0" /&gt;
                 &lt;/padding&gt;&lt;/JFXSlider&gt;
              &lt;/children&gt;
          &lt;/VBox&gt;
      &lt;/bottom&gt;
  &lt;/BorderPane&gt;
  </code></pre>