I have two radio buttons, both added to a ButtonGroup
. I have added an ActionListener
for both. Suppose that at present the first radio button is selected, then again if I click on the same button then again actionPerformed()
will be called. It doesn't look good. I want to prevent the call to actionPerformed()
if that radio button is already selected.
One possible way could be to store current selected radio button state in a variable, but I want to know the java internal method for this.
Is there any method to do this?