File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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: 38039
    
  22
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.
 
jQuery in Action, 2nd edition
 
subject: 1st Radio Button always being true in Jface /swt
 
Similar Threads
Prepopulating Radio buttons in JSP
difference between Swing, SWT and Jfaces?
want to get the value of selected radio button
display radio button as selected
radio button using javascript DOM