87
JavaFX StackPane
The StackPane layout pane places all the nodes into a single stack where every new node gets placed on the top of the previous node. It is represented by javafx.scene.layout.StackPane class. We just need to instantiate this class to implement StackPane layout into our application.
Properties
The class contains only one property that is given below along with its setter method.
Property | Description | Setter Method |
---|---|---|
alignment | It represents the default alignment of children within the StackPane’s width and height | setAlignment(Node child, Pos value) setAlignment(Pos value) |
Constructors
The class contains two constructors that are given below.
- StackPane()
- StackPane(Node? Children)
Example
Output:
Next TopicJavaFX GridPane