简体   繁体   English

SceneBuilder 中的 AnchorPane 和 Pane 有什么区别? 我应该什么时候使用它们?

[英]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 中AnchorPanePane之间的AnchorPane ,以及何时应该使用AnchorPane以及何时应该使用Pane

Thanks in advance.提前致谢。

Check this link on quora about the differences between AnchorPane and Pane .quora上查看有关AnchorPanePane之间差异的链接。

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请务必查看PaneAnchorPane 的官方文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 (JavaFX)(SceneBuilder)如果将所有内容都设置为AnchorPane,则在调整窗口大小时如何自动调整场景大小? - (JavaFX)(SceneBuilder) How can I automatically resize the scene when the window is resized if everything is set into a AnchorPane? 我应该使用SceneBuilder还是在代码中实现布局? - Should I use SceneBuilder or implement layout in code? JApplet和Applet之间有什么区别,我应该使用哪个? - What is the difference between JApplet and Applet, and which should I use? CacheResolver和KeyGenerator有什么区别,何时使用它们中的每一个 - What is the difference between CacheResolver and KeyGenerator and when to use each one of them doOnSuccess和doOnEach之间的区别,其中用例我应该使用它们中的每一个 - Difference between doOnSuccess and doOnEach, and in which use case i should use each of them JavaFX中的Pane和stackPane有什么区别? - what is the difference between Pane and stackPane in javaFX? 创建数组时使用 new 与不使用有什么区别? - What's difference between use new or not when i create an array? 偏好和共享偏好之间的区别? 铃声设置应该使用什么? - Difference between preference and shared preference? and what should use with Ringtone settings? 如何在SceneBuilder中获得窗格的回合? - How can i get the pane's round in the scenebuilder? Akka 中 Typed 和 UnTyped Actor 有什么区别? 什么时候用什么? - What is the difference between Typed and UnTyped Actors in Akka? When to use what?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM