【发布时间】:2017-01-14 10:14:42
【问题描述】:
我想创建带有 3 个单选按钮(comm、med、all)的菜单。 Where for example Comm button should create hbox, but when the other option is selected, this hbox should disapear, but it wont.
谁能给我指明正确的方向? 十分感谢。
这是我得到的:
comm.setOnAction(new EventHandler<ActionEvent>() {
@Override public void handle(ActionEvent e) {
if(comm.isSelected())
root.add(commBox, 0,1);
else if(med.isSelected()||all.isSelected())
root.getChildren().remove(commBox);
}
});
【问题讨论】:
-
您想隐藏它以便能够再次显示它还是完全删除它?如果是第二种选择,你为什么要这样做?
标签: javafx radio-button root