How to manage two JRadioButtons in java so that only one of them can be selected at a time? Is there any method in java to take care of this or you need to build your own logic?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
You have to add them in a ButtonGroup
Ensure you add this code after the buttons are created using the new
JRadioButton
constructors, as appropriate.My java is rusty but if i remember correctly you have to use the ButtonGroup class. Add your radio buttons to ButtonGroup object. I think it will look like this.
Hope this helps. I have abandoned Java years ago.