GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes 1st Radio Button always being true in Jface /swt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "1st Radio Button always being true in Jface /swt" Watch "1st Radio Button always being true in Jface /swt" New topic
Author

1st Radio Button always being true in Jface /swt

Keith Spriggs
Greenhorn

Joined: Jul 19, 2012
Posts: 18
Hi Guys,
Here is a puzzler, every time I create a group of radio buttons in SWT/JFace, the first button is always true, but if create a standard button and call it to reset the radio button it will reset to being false.
I would like it to be set to false as default.
Has any encountered a problem like this and how to solve it?
Thanks in advance

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39062
    
  23
In this section of the Java™ Tutorials, the second and third subsections are about buttons and button groups. Have a look. You can use the setSelected method and/or a boolean parameter in the constructor to pre‑select a particular radio button.
 
GeeCON Prague 2014
 
subject: 1st Radio Button always being true in Jface /swt