How are the objects in an HBox
arranged?
Shapes added to anHBox
are arranged into a single horizontal row in the order they were added. The tops of the shapes touch the top border of theHBox
What size is picked for an HBox
?
The size of the HBox
is the smallest box that encloses all the shapes (the bounding box.)
HBox
and VBox
HBox
and VBox
lay out their children in a single line,
either horizontal or vertical,
in the order they are added.
These and other Pane
s have many features,
such as margins and spacing between nodes.
There are other kinds of Pane
s that perform
different kinds of layout.
Layout Pane
s are very useful for designing
graphical user interfaces (GUIs).
See a future chapter for this.
(Thought Question: ) Could a VBox
containing several Nodes
be one of several Nodes
added to an HBox
?