Remove all children from the group, not knowing the contained nodes

check this

Group g = new Group(); GridPane grid = new GridPane(); // g.getChildren().addAll(grid); 

now my question is: how to remove this "grid" from "g" without specifying a "grid", something like this

 g.getChildren().removeAll(null); //i do not know what to insert here? 

early

+9
source share
1 answer

If you want to remove all elements from the collection, use the clear() method:

 g.getChildren().clear(); 
+18
source

Source: https://habr.com/ru/post/1207424/


All Articles