HBox layout pane arranges the nodes in a single row. It is represented by javafx.scene.layout.HBox class. We just need to instantiate HBox class in order to create HBox layout.
The Properties of the class along with their setter methods are given in the table below.
||This represents the alignment of the nodes.
||This is a boolean property. If you set this property to true the height of the nodes will become equal to the height of the HBox.
||This represents the space between the nodes in the HBox. It is of double type.
The HBox class contains two constructors that are given below.
- new HBox() : create HBox layout with 0 spacing
- new Hbox(Double spacing) : create HBox layout with a spacing value
Example : Setting the space among the nodes.