[英]What is the difference between AnchorPane and Pane in SceneBuilder? And when should I use each?
I am new to Scene Builder and it's functions so expect a lot of questions in the coming days regarding it.我是 Scene Builder 的新手,它的功能因此预计在未来几天会有很多关于它的问题。 I am self teaching myself programming of Java and SQL so my only teachers are you guys.
我正在自学 Java 和 SQL 编程,所以我唯一的老师是你们。
At the moment I am stuck understanding the difference between AnchorPane
and Pane
in Scene Builder and when should I use AnchorPane
and when should I use Pane
.目前,我
AnchorPane
理解 Scene Builder 中AnchorPane
和Pane
之间的AnchorPane
,以及何时应该使用AnchorPane
以及何时应该使用Pane
。
Thanks in advance.提前致谢。
Check this link on quora about the differences between AnchorPane
and Pane
.在quora上查看有关
AnchorPane
和Pane
之间差异的链接。
As stated there, AnchorPane
is more flexible and the children of AnchorPane
can be dynamically resized as it allows the edges of the children nodes to be "anchored" to the edges of the AnchorPane
.如前所述,
AnchorPane
更灵活,并且AnchorPane
的子节点可以动态调整大小,因为它允许子节点的边缘“锚定”到AnchorPane
的边缘。 In other words, the child element will 'hold onto' the sides of the AnchorPane
.换句话说,子元素将“抓住”
AnchorPane
的两侧。 Pane
on the other hand is used when dynamic resizing of the window is not needed.另一方面,当不需要动态调整窗口大小时使用
Pane
。
Be sure to check out this official documentation for Pane and AnchorPane请务必查看Pane和AnchorPane 的官方文档
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.