In a project, I added ItemListener to a group of JcheckBox and JRadioButtons.
And I want that when a user click on already selected JRadioButton, it gets deselected.
For this only method I know is getting Corresponding ButtonGroup and then calling clearSelection() method. But in itemStateChanged() method I have JtoggleButton option=(JtoggleButton)event.getSource();
So option refers to either JRadioButton or JcheckBox. I have searched but I cannot able to find a method to get ButtonGroup for a JRadioButton.