【发布时间】:2014-03-15 21:29:55
【问题描述】:
我正在尝试从其项目中清除 HBox。我尝试使用 hBox.getChildren().clear(),甚至循环
for(Node child: hBox.getChildren()){
hBox.getChildren().remove(child);
}
但没有一个工作。有什么想法吗?
【问题讨论】:
我正在尝试从其项目中清除 HBox。我尝试使用 hBox.getChildren().clear(),甚至循环
for(Node child: hBox.getChildren()){
hBox.getChildren().remove(child);
}
但没有一个工作。有什么想法吗?
【问题讨论】:
删除版本会给你一个 ConcurrentModificationException - clear 应该可以工作 - 至少它对我有用
【讨论】:
hBox.clear(),必须是hBox.getChildren().clear();。