void (ButtonGroup group, int i) { final Enumeration<AbstractButton> buttons = group.getElements(); for (int j = 0; buttons.hasMoreElements(); j++) { group.setSelected(buttons.nextElement().getModel(), i == j); } }