All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.awt.Choice

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----jp.kyasu.awt.KContainer
                           |
                           +----jp.kyasu.awt.EventProxyContainer
                                   |
                                   +----jp.kyasu.awt.List
                                           |
                                           +----jp.kyasu.awt.Choice

public class Choice
extends List
The Choice class presents a pop-up menu of choices. The current choice is displayed as the title of the menu.

Version:
15 Jun 1998
Author:
Kazuki YASUMATSU
See Also:
List

Constructor Index

 o Choice()
Creates a new choice menu.
 o Choice(RichTextStyle)
Creates a new choice menu.

Method Index

 o addItem(String, int)
Adds an item to this Choice.
 o addTextItem(Text, int)
Adds a text item to this Choice.
 o getMinimumSize()
Returns the minimum dimensions for a choice.
 o getPreferredSize()
Returns the preferred dimensions for a choice.
 o getSelectedObjects()
Returns an array (length 1) containing the currently selected item.
 o insert(String, int)
Inserts the item into this choice at the specified position.
 o insert(Text, int)
Inserts the text item into this choice at the specified position.
 o itemStateChanged(ItemEvent)
Invoked when an item's state has been changed.
 o setBounds(int, int, int, int)
Moves and resizes this choice.
 o setEnabled(boolean)
Enables or disables this choice.

Constructors

 o Choice
 public Choice()
Creates a new choice menu. The menu initially has no items in it.

By default, the first item added to the choice menu becomes the selected item, until a different selection is made by the user by calling one of the select methods.

 o Choice
 public Choice(RichTextStyle richTextStyle)
Creates a new choice menu. The menu initially has no items in it.

By default, the first item added to the choice menu becomes the selected item, until a different selection is made by the user by calling one of the select methods.

Parameters:
richTextStyle - the rich text style for the choice.

Methods

 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
Invoked when an item's state has been changed.

Overrides:
itemStateChanged in class List
See Also:
ItemListener
 o setEnabled
 public synchronized void setEnabled(boolean b)
Enables or disables this choice.

Overrides:
setEnabled in class List
 o getPreferredSize
 public Dimension getPreferredSize()
Returns the preferred dimensions for a choice.

Overrides:
getPreferredSize in class List
 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum dimensions for a choice.

Overrides:
getMinimumSize in class List
 o setBounds
 public synchronized void setBounds(int x,
                                    int y,
                                    int width,
                                    int height)
Moves and resizes this choice.

Overrides:
setBounds in class KContainer
 o getSelectedObjects
 public synchronized Object[] getSelectedObjects()
Returns an array (length 1) containing the currently selected item. If this choice has no items, returns null.

Overrides:
getSelectedObjects in class List
 o addItem
 public synchronized void addItem(String item,
                                  int index)
Adds an item to this Choice.

Parameters:
item - the item to be added
Throws: NullPointerException
If the item's value is equal to null.
Overrides:
addItem in class List
 o insert
 public synchronized void insert(String item,
                                 int index)
Inserts the item into this choice at the specified position.

Parameters:
item - the item to be inserted
index - the position at which the item should be inserted
Throws: IllegalArgumentException
if index is less than 0.
 o addTextItem
 public synchronized void addTextItem(Text item,
                                      int index)
Adds a text item to this Choice.

Parameters:
item - the text item to be added
Throws: NullPointerException
If the item's value is equal to null.
Overrides:
addTextItem in class List
 o insert
 public synchronized void insert(Text item,
                                 int index)
Inserts the text item into this choice at the specified position.

Parameters:
item - the text item to be inserted
index - the position at which the item should be inserted
Throws: IllegalArgumentException
if index is less than 0.

All Packages  Class Hierarchy  This Package  Previous  Next  Index