在javaFX中Pane和stackPane有什么区别? [英] what is the difference between Pane and stackPane in javaFX?

查看:1674
本文介绍了在javaFX中Pane和stackPane有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习javafx,并且遇到了这两个我不知道它们不同的陈述。

I was learning javafx and came across these two statements which I don't know their difference.

Pane pane = new Pane();

StackPane pane = new StackPane();

有人可以告诉我有关差异以及何时使用哪个?

Can somebody enlighten me about the difference and when to use which?

推荐答案

两者都是布局,但窗格是所有的基础其他布局,区别在于Pane提供了一个免费的节点定位,以及 StackPane (以及其他带有后缀Pane的Node,名为内置布局)作为回报,遵循自己的逻辑(位置/约束......)。例如,'StackPane'以后向前的方式展示其子代 StackPane 。这只是表面和有限的信息,这是一个很好的教程: JavaFX中的布局

Both are layouts but the Pane is the basis of all the other layouts, the difference is that the Pane offers a free positioning of nodes, and The StackPane (and other Node with the suffix Pane called Built-in Layout) in return, follow their own logic (Positions/Constraints...). The 'StackPane' for example lays out its children in a back-to-front stack StackPane. This is only superficial and limited information, here's a good tutorial : Layout in JavaFX

这篇关于在javaFX中Pane和stackPane有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆