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
When creating a group of radio buttons, exactly one from them HAS to be selected at a time. By selecting a different button, the first one becomes unselected. Therefor, if you set selected true to second radio button, the first will be unselected.
If you create a group of radio buttons, the first one is always selected by default. Use
secondRadioButton.setSelection(true);
to change the state...