Unselecting RadioButtons in Java Swing

前端 未结 10 1477
鱼传尺愫
鱼传尺愫 2021-01-01 09:06

When displaying a group of JRadioButtons, initially none of them is selected (unless you programmatically enforce that). I would like to be able to put buttons back into tha

10条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-01 09:36

    Try adding a third invisible button to the button group. When you want to "deselect", select the invisible one.

提交回复
热议问题