- Mastering JavaFX 10
- Sergey Grinev
- 43字
- 2021-06-25 21:21:54
AnchorPane layout manager
This manager allows you to anchor any child Node to its sides to keep them in place during resizing:

Refer to the following code:
Rectangle rect = new Rectangle(50, 50, Color.BLUE);
Pane root = new AnchorPane(rect);
AnchorPane.setRightAnchor(rect, 20.);
AnchorPane.setBottomAnchor(rect, 20.);