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