You are always setting it to true
by
button[i].setSelection(true);
that's why you always get true. You need to set the button
once you make a selection. Do you have a listener attached to it. You have to use
void addSelectionListener(SelectionListener listener)
Adds the listener to the collection of listeners who will be notified when the control is selected by the user, by sending it one of the messages defined in the SelectionListener interface.
Please read the documentation on SelectionListener. You have to use
void widgetSelected(SelectionEvent e)
Sent when selection occurs in the control.
void widgetDefaultSelected(SelectionEvent e)
Sent when default selection occurs in the control.