JCheckBoxMenuItem only one selected
问题 So I want to have a JMenu Level with three JCheckBoxMenuItem like Easy, normal and expert. Of course, only one can be checked and if one is checked, it can't be unchecked (enabled(false)) because it's the only one. I want when one JCheck is checked, all others are unchecked. So it seems easy, but the only solution I found is to do it with a lot of "if" conditions. Is there a way to do it with a better algorithm ? 回答1: It sounds like you'd be better off using a JRadioButton since check boxes