tags:

views:

6

answers:

1

When tried to port my code from Sun JDK to Apache Harmony, The clearSelection() method of the the ButtonGroup objects was flaged as a compilation error. What can I do instead?

A: 

Something like

Enumeration<ButtonModel> buttons = buttonGroup.getElements();
while(buttons.hasMoreElements()) {
  buttonGroup.setSelected(buttons.nextElement().getModel(), false);
}

Iterate through the group and set each buttons selection state to false.

Andreas_D