I can't really understand how this stretching works in JavaFX. I have my prefWidth to Infinity both for the HBox and the TextField, so the TextField should be larger if we resize the frame. Please help me, what am I missing here. Thank you.
<GridPane fx:id="first" hgap="5" vgap="5" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" >
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" percentWidth="100.0" />
</columnConstraints>
<VBox.margin>
<Insets left="10.0" top="15"/>
</VBox.margin>
<HBox GridPane.columnIndex="0" GridPane.rowIndex="0" prefWidth="Infinity" maxWidth="Infinity">
<fx:define>
<ToggleGroup fx:id="myToggleGroup"/>
</fx:define>
<children>
<RadioButton text="System" toggleGroup="$myToggleGroup">
</RadioButton>
<RadioButton text="Document" toggleGroup="$myToggleGroup">
<HBox.margin>
<Insets left="200.0"/>
</HBox.margin>
</RadioButton>
</children>
</HBox>
<HBox GridPane.rowIndex="1" GridPane.columnIndex="0" >
<Label text="Name:" minWidth="50">
</Label>
<TextField maxWidth="Infinity" minWidth="450" prefWidth="Infinity">
<HBox.margin>
<Insets left="20.0"/>
</HBox.margin>
</TextField>
</HBox>