在 swing 中我们有 JlayeredPane,这与 javafx 中的等效吗? 以这段代码为例:
JLayeredPane panel = new JLayeredPane();
JLabel test1 = new JLabel("Test 1");
JLabel test2 = new JLabel("Test 2");
panel.setLayer(test1, 0);
panel.add(test1);
panel.setLayer(test2, 1);
panel.add(test2);
如何在javafx中进行翻译?
最佳答案
Swing JLayeredPane
的等效项是 StackPane .
The z-order of the children is defined by the order of the children list with the 0th child being the bottom and last child on top. If a border and/or padding have been set, the children will be layed out within those insets.
其中“子列表”是指由 StackPane.getChildren()
返回的 ObservableList
。
关于java - 哪个相当于 javaFX 中的 JLayeredPane?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27689303/