在节点中我有很多矩形和图片。通过单击箭头按钮,它们都必须向相反的方向移动。我没有找到以某种方式将所有这些元素合并为一个或移动节点及其子节点的方法。唯一的方法是分别更改每个元素的位置吗?
最佳答案
Google 仍然帮助我找到了这个问题的答案。
There is no merging mechanism for all members of the same group. You can use only one group / container to store all your items.
只剩下使用类似的东西了
for(Node node:vBox.getChildren()) {
node.setDisable(true);
}
关于java - 如何简化多个元素的移动?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53904759/