kAWT Version 0.98

java.awt
Class Choice

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Choice

public class Choice
extends Component
implements ItemSelectable


Constructor Summary
Choice()
           
 
Method Summary
 void add(String item)
          Adds an item to the Choice.
 void addItem(String item)
          Adds an item to the Choice.
 void addItemListener(ItemListener l)
          Adds an item listener to the choice.
 String getItem(int index)
          returns the item at the given index
 int getItemCount()
          Returns the number of items in the choice
 Dimension getMinimumSize()
          returns the minimum dimensions of the choice
 int getSelectedIndex()
          Returns the index of the selected item.
 String getSelectedItem()
          Returns the selected item
 Object[] getSelectedObjects()
          Returns an object array containing the selected objects
 void paint(Graphics g)
          Paints the choice.
 void remove(int index)
          Removes the item at the given index from the choice.
 void remove(String item)
          Removes the given item from the choice.
 void removeItemListener(ItemListener l)
          Removes the item listener from the choice.
 void select(int index)
          Setlects the item at the given index
 void select(String item)
          Selects the given item
 
Methods inherited from class java.awt.Component
addKeyListener, addMouseListener, addMouseMotionListener, contains, findComponentAt, getBackground, getBounds, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getLocationOnScreen, getMaximumSize, getParent, getPreferredSize, getSize, getWidth, getX, getY, hasFocus, invalidate, isEnabled, isFocusTraversable, isValid, isVisible, paintAll, processKeyEvent, processMouseEvent, repaint, repaint, requestFocus, setBackground, setBounds, setEnabled, setForeground, setLocation, setSize, setSize, setVisible, update, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Choice

public Choice()
Method Detail

add

public void add(String item)
Adds an item to the Choice.

addItem

public void addItem(String item)
Adds an item to the Choice.

addItemListener

public void addItemListener(ItemListener l)
Adds an item listener to the choice. The listener is notified when an item is selected or deselected. Attention: kAWT supports only one item listener per choice.
Specified by:
addItemListener in interface ItemSelectable

getItem

public String getItem(int index)
returns the item at the given index

getItemCount

public int getItemCount()
Returns the number of items in the choice

getSelectedIndex

public int getSelectedIndex()
Returns the index of the selected item.

getSelectedItem

public String getSelectedItem()
Returns the selected item

getSelectedObjects

public Object[] getSelectedObjects()
Returns an object array containing the selected objects
Specified by:
getSelectedObjects in interface ItemSelectable

getMinimumSize

public Dimension getMinimumSize()
returns the minimum dimensions of the choice
Overrides:
getMinimumSize in class Component

paint

public void paint(Graphics g)
Paints the choice.
Overrides:
paint in class Component

remove

public void remove(String item)
Removes the given item from the choice.

remove

public void remove(int index)
Removes the item at the given index from the choice.

removeItemListener

public void removeItemListener(ItemListener l)
Removes the item listener from the choice.
Specified by:
removeItemListener in interface ItemSelectable

select

public void select(int index)
Setlects the item at the given index

select

public void select(String item)
Selects the given item

kAWT Version 0.98