If an hbox is resized larger than its preferred width, by default it will keep children to their preferred widths, leaving the extra space unused. If an application wishes to have one or more children be allocated that extra space it may optionally set an hgrow constraint on the child. See “Optional Layout Constraints” for details.
UI controls also provide default minimum and maximum sizes that are based on the typical usage of the control. For example, the maximum size of a Button object defaults to its preferred size because you don’t usually want buttons to grow arbitrarily large.
To enable all of the buttons to be resized to the width of the
VBoxpane, the maximum width of each button is set to the
Double.MAX_VALUEconstant, which enables a control to grow without limit. An alternative to using the maximum value constant is to set the maximum width to a specific value, such as 80.0.