Clearing an HBox in javafx


Question

I am trying to clear an HBox from its items. I tried using hBox.getChildren().clear(), and even looping

for(Node child: hBox.getChildren()){
    hBox.getChildren().remove(child);
}

but neither one works. Any ideas?

1
3
2/17/2014 12:39:30 AM

The remove version will give you a ConcurrentModificationException - clear should just work - at least it works for me

1
2/16/2014 9:17:50 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon