Cloning children of pane - JavaFX

孤街醉人 提交于 2020-01-04 07:47:11

问题


So I have a Pane with some components in it (Groups and Polygons) and I wanted to make a copy of this Pane, but whenever I do the following it seems like it deletes the children of the original Pane and transfers it to the new one.

Pane pane1 = new Pane();
pane1.getChildren().addAll(poly1, poly2, poly3, group1, group2);
Pane pane2 = new Pane();
pane2.getChildren().addAll(pane1.getChildren());

So my question is, how do you copy these children without removing them from the original Pane?

来源:https://stackoverflow.com/questions/36112903/cloning-children-of-pane-javafx

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!