Choice (Java Platform SE 8 ) (original) (raw)

Modifier and Type

Method

Description

void

[add](../../java/awt/Choice.html#add-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") item)

Adds an item to this Choice menu.

void

[addItem](../../java/awt/Choice.html#addItem-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") item)

Obsolete as of Java 2 platform v1.1.

void

[addItemListener](../../java/awt/Choice.html#addItemListener-java.awt.event.ItemListener-)([ItemListener](../../java/awt/event/ItemListener.html "interface in java.awt.event") l)

Adds the specified item listener to receive item events from this Choice menu.

void

[addNotify](../../java/awt/Choice.html#addNotify--)()

Creates the Choice's peer.

int

[countItems](../../java/awt/Choice.html#countItems--)()

[AccessibleContext](../../javax/accessibility/AccessibleContext.html "class in javax.accessibility")

[getAccessibleContext](../../java/awt/Choice.html#getAccessibleContext--)()

Gets the AccessibleContext associated with thisChoice.

[String](../../java/lang/String.html "class in java.lang")

[getItem](../../java/awt/Choice.html#getItem-int-)(int index)

Gets the string at the specified index in thisChoice menu.

int

[getItemCount](../../java/awt/Choice.html#getItemCount--)()

Returns the number of items in this Choice menu.

[ItemListener](../../java/awt/event/ItemListener.html "interface in java.awt.event")[]

[getItemListeners](../../java/awt/Choice.html#getItemListeners--)()

Returns an array of all the item listeners registered on this choice.

<T extends [EventListener](../../java/util/EventListener.html "interface in java.util")> T[]

[getListeners](../../java/awt/Choice.html#getListeners-java.lang.Class-)([Class](../../java/lang/Class.html "class in java.lang")<T> listenerType)

Returns an array of all the objects currently registered as _Foo_Listeners upon this Choice.

int

[getSelectedIndex](../../java/awt/Choice.html#getSelectedIndex--)()

Returns the index of the currently selected item.

[String](../../java/lang/String.html "class in java.lang")

[getSelectedItem](../../java/awt/Choice.html#getSelectedItem--)()

Gets a representation of the current choice as a string.

[Object](../../java/lang/Object.html "class in java.lang")[]

[getSelectedObjects](../../java/awt/Choice.html#getSelectedObjects--)()

Returns an array (length 1) containing the currently selected item.

void

[insert](../../java/awt/Choice.html#insert-java.lang.String-int-)([String](../../java/lang/String.html "class in java.lang") item, int index)

Inserts the item into this choice at the specified position.

protected [String](../../java/lang/String.html "class in java.lang")

[paramString](../../java/awt/Choice.html#paramString--)()

Returns a string representing the state of this Choice menu.

protected void

[processEvent](../../java/awt/Choice.html#processEvent-java.awt.AWTEvent-)([AWTEvent](../../java/awt/AWTEvent.html "class in java.awt") e)

Processes events on this choice.

protected void

[processItemEvent](../../java/awt/Choice.html#processItemEvent-java.awt.event.ItemEvent-)([ItemEvent](../../java/awt/event/ItemEvent.html "class in java.awt.event") e)

Processes item events occurring on this Choice menu by dispatching them to any registeredItemListener objects.

void

[remove](../../java/awt/Choice.html#remove-int-)(int position)

Removes an item from the choice menu at the specified position.

void

[remove](../../java/awt/Choice.html#remove-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") item)

Removes the first occurrence of item from the Choice menu.

void

[removeAll](../../java/awt/Choice.html#removeAll--)()

Removes all items from the choice menu.

void

[removeItemListener](../../java/awt/Choice.html#removeItemListener-java.awt.event.ItemListener-)([ItemListener](../../java/awt/event/ItemListener.html "interface in java.awt.event") l)

Removes the specified item listener so that it no longer receives item events from this Choice menu.

void

[select](../../java/awt/Choice.html#select-int-)(int pos)

Sets the selected item in this Choice menu to be the item at the specified position.

void

[select](../../java/awt/Choice.html#select-java.lang.String-)([String](../../java/lang/String.html "class in java.lang") str)

Sets the selected item in this Choice menu to be the item whose name is equal to the specified string.