![Mastering JavaFX 10](https://wfqqreader-1252317822.image.myqcloud.com/cover/811/36699811/b_36699811.jpg)
上QQ阅读APP看书,第一时间看更新
AnchorPane layout manager
This manager allows you to anchor any child Node to its sides to keep them in place during resizing:
![](https://epubservercos.yuewen.com/0A344C/19470392808882006/epubprivate/OEBPS/Images/Chapter_130.jpg?sign=1739603308-pwhZXKcz8PUJZyZ7ZDNjLpOAuHbr0CIL-0-2c76b4534524393f68998de85d62f1f5)
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.);