有没有办法删除 JavaFx 中 vBox 中的所有内容?

Is there a way to remove all the contents in vBox in JavaFx?

我正在尝试做一个 Javafx 项目。我有一些问题。 我在 vBox 中放置了一个文本(标签)列表。有没有办法删除 vBox 中的所有文本?例如,当我点击一个按钮 "Remove" 时,vBox 中的所有内容都会消失。 有可能这样做吗?

哦!我刚刚弄明白了。 我可以使用 vBox.getChildren().clear(); 有效!

vBox.getChildren().removeAll(vBox.getChildren());

也有效