25.4.5 Changing to a VBox Layout Container

For this app, you’ll place a Label and an ImageView in a VBox layout container (package javafx.scene.layout), which will be the scene graph’s root node. Layout containers help you arrange and size GUI components. A VBox arranges its nodes vertically from top to bottom. VBox is one of several JavaFX layout containers for arranging controls in a GUI. We discuss the GridPane layout container in Section 25.5 and several others in online Chapter 26. By default, NetBeans provides an AnchorPane as the root layout. To change from the default AnchorPane to a VBox:

1. Adding a VBox to the Default Layout. Drag a VBox from the Library window’s Containers section onto the default AnchorPane in Scene Builder’s content ...

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.