aspose file tools*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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: 38392
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 1st Radio Button always being true in Jface /swt