Methods of java.awt.Choice

The Choice class has a number of methods to add, remove, and return different items from the list. The list starts counting at 0.

  public int getItemCount()
  public String getItem(int index)
  public synchronized void add(String item)
  public synchronized void addItem(String item)
  public synchronized void insert(String item, int position)
  public synchronized void remove(String item)
  public synchronized void remove(int position)
  public synchronized void removeAll()
However, most of the item you'll just build the Choice when the applet starts up, and not modify it later.

These methods get or set the current selected item in the Choice, that is the item that's shown.

  public synchronized void removeAll()
  public synchronized String getSelectedItem()
  public synchronized Object[] getSelectedObjects()
  public int getSelectedIndex()
  public synchronized void select(int position)
  public synchronized void select(String item)

Previous | Next | Top
Last Modified August 5, 1997
Copyright 1997 Elliotte Rusty Harold
elharo@metalab.unc.edu