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
-
Choice()
- Creates a new choice menu.
-
Choice(RichTextStyle)
- Creates a new choice menu.
-
addItem(String, int)
- Adds an item to this Choice.
-
addTextItem(Text, int)
- Adds a text item to this Choice.
-
getMinimumSize()
- Returns the minimum dimensions for a choice.
-
getPreferredSize()
- Returns the preferred dimensions for a choice.
-
getSelectedObjects()
- Returns an array (length 1) containing the currently selected
item.
-
insert(String, int)
- Inserts the item into this choice at the specified position.
-
insert(Text, int)
- Inserts the text item into this choice at the specified position.
-
itemStateChanged(ItemEvent)
- Invoked when an item's state has been changed.
-
setBounds(int, int, int, int)
- Moves and resizes this choice.
-
setEnabled(boolean)
- Enables or disables this choice.
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.
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.
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Invoked when an item's state has been changed.
- Overrides:
- itemStateChanged in class List
- See Also:
- ItemListener
setEnabled
public synchronized void setEnabled(boolean b)
- Enables or disables this choice.
- Overrides:
- setEnabled in class List
getPreferredSize
public Dimension getPreferredSize()
- Returns the preferred dimensions for a choice.
- Overrides:
- getPreferredSize in class List
getMinimumSize
public Dimension getMinimumSize()
- Returns the minimum dimensions for a choice.
- Overrides:
- getMinimumSize in class List
setBounds
public synchronized void setBounds(int x,
int y,
int width,
int height)
- Moves and resizes this choice.
- Overrides:
- setBounds in class KContainer
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
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
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.
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
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