java.awt.Choice (JDK 1.0)
This class represents an "option menu" or "dropdown list." The addItem() method adds an item with the specified label to a Choice menu. getSelectedIndex() returns the numerical position of the selected item in the menu, and getSelectedItem() returns the label of the selected item.
public classChoiceextends Component implements ItemSelectable { //Public ConstructorpublicChoice(); //Public Instance Methods1.1 public synchronized voidadd(Stringitem); public synchronized voidaddItem(Stringitem); 1.1 public synchronized voidaddItemListener(ItemListenerl); //From ItemSelectablepublic voidaddNotify(); //Overrides Component# public intcountItems(); public StringgetItem(intindex); 1.1 public intgetItemCount(); public intgetSelectedIndex(); public synchronized StringgetSelectedItem(); 1.1 public synchronized Object[]getSelectedObjects(); //From ItemSelectable1.1 public synchronized voidinsert(Stringitem, intindex); 1.1 public synchronized voidremove(Stringitem); 1.1 public synchronized voidremove(intposition); 1.1 public synchronized voidremoveAll(); 1.1 public synchronized voidremoveItemListener(ItemListenerl); //From ItemSelectablepublic synchronized voidselect(intpos); public synchronized voidselect(Stringstr); //Protected Instance Methodsprotected StringparamString(); //Overrides Component1.1 protected voidprocessEvent(AWTEvente); //Overrides Component1.1 protected voidprocessItemEvent(ItemEvente); }
Hierarchy:
Object->Component(ImageObserver, MenuContainer, Serializable)->Choice(ItemSelectable)
Passed To:
Toolkit.createChoice()