Reputation: 57
Is there any way to allow a region of a BorderPane overlays other region?
In my project I want a triangle in the top of the first BorderPane to fit in in the top of the inner BorderPane in the center region of the first BorderPane. I want is to fit those triangles in the region to create a flow.
In the picture bellow I have two BorderPane. The red rectangle is the center region of the first BorderPane, which contains a BorderPane. The green rectangle is in the top region of the first BorderPane. The blue rectangle is in the bottom region of the inner BorderPane.
Is there any way to do that or I will have to change the layout strategy?
Thank you!
Upvotes: 0
Views: 882
Reputation: 10869
A StackPane
does this by overlaying children on top of them. It also allows you to position them, additionally you can add margin
s and padding
s to your Nodes.
will have to change the layout strategy?
yes please, Use StackPane
. the child at the 0 index is the last child and the child at the Stackpane.getChildren().size()-1
is the first child, the one you see layered on top
Upvotes: 1