I\'ve got a problem with the view of the application gui in Scene Builder in comparison to running one.
The app UI in the scene builder preview looks like this:
In SceneBuilder, set the Max Height and Max Width to USE_PREF_SIZE
. Likewise, you can also set the min values.
Also, for a scene such as this, BorderPane might be overkill. You could easily use a StackPane with an VBox, or even a GridPane.
!! Edit !!
Try this:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.layout.BorderPane?>
<AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="180.0" prefWidth="260.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1">
<children>
<VBox layoutX="45.0" layoutY="37.0" spacing="12.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
<children>
<TextField fx:id="txtUserName" />
<TextField fx:id="txtPassword" />
<HBox>
<children>
<Pane HBox.hgrow="ALWAYS" />
<Button fx:id="btnOk" mnemonicParsing="false" text="Button" />
</children>
</HBox>
</children>
<padding>
<Insets bottom="18.0" left="18.0" right="18.0" top="18.0" />
</padding>
</VBox>
</children>
</AnchorPane>