List of usage examples for javax.swing ButtonModel setSelected
public void setSelected(boolean b);
From source file:org.rdv.viz.image.ImageViz.java
/** * Select the correct radio button for the maximum number of filmstrip images. *//* w ww . jav a2 s .c o m*/ private void updateMaximumFilmstripImagesRadioButtons() { int maximumFilmstripImages = filmstripPanel.getMaximumImages(); int index = Arrays.binarySearch(MAXIMUM_FILMSTRIP_IMAGES_VALUES, maximumFilmstripImages); if (index >= 0) { Enumeration<AbstractButton> elements = maximumFilmstripImagesButtonGroup.getElements(); AbstractButton button = null; while (index-- >= 0) { button = elements.nextElement(); } maximumFilmstripImagesButtonGroup.setSelected(button.getModel(), true); } else { ButtonModel buttonModel = maximumFilmstripImagesButtonGroup.getSelection(); if (buttonModel != null) { buttonModel.setSelected(false); } } }