/** * Sets the value selected. * * @param value the value to make selected */ public void setValue(E value) { ImageIcon icon = icons[value.ordinal()]; setSelectedItem(icon); }
/** * Returns the value currently selected. * * @return the value currently selected */ public E getValue() { ImageIcon icon = (ImageIcon) getSelectedItem(); return E.valueOf(enumeration, icon.getDescription()); }