Generic solution to deselect buttons in java

Posted by Hectoret on Stack Overflow See other posts from Stack Overflow or by Hectoret
Published on 2010-04-26T11:12:45Z Indexed on 2010/04/26 11:13 UTC
Read the original article Hit count: 96

Filed under:
|

In a set of radio buttons of the same group, only one can be selected at the same time. I would like to have the same behaviour with a normal button.

Imagine there's a row of 3 buttons. When a button is selected it changes: but.setSelected(true) and the other two buttons should be NOT selected: but.setSelected(false)

Now, is there a generic, simple and clean solution to accomplish that in Java (Swing) ?

© Stack Overflow or respective owner

Related posts about java

Related posts about swing