问题
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