25.4.6 Configuring the VBox Layout Container

You’ll now specify the VBox’s alignment, initial size and padding:

1. Specifying the VBox’s Alignment. A VBox’s alignment determines the layout positioning of the VBox’s children. In this app, we’d like each child node (the Label and the ImageView) to be centered horizontally in the scene, and we’d like both children to be centered vertically, so that there is an equal amount of space above the Label and below the ImageView. To accomplish this, select the VBox, then in the Inspector’s Properties section, set the Alignment property to CENTER. When you set the Alignment, notice the variety of potential alignment values you can use.

2. Specifying the VBox’s Preferred Size. The preferred size (width and ...

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.