jdk/src/share/classes/java/awt/Choice.java
Print this page
*** 83,93 ****
* @see #getItem(int)
* @see #getItemCount()
* @see #insert(String, int)
* @see #remove(String)
*/
! Vector pItems;
/**
* The index of the current choice for this <code>Choice</code>
* or -1 if nothing is selected.
* @serial
--- 83,93 ----
* @see #getItem(int)
* @see #getItemCount()
* @see #insert(String, int)
* @see #remove(String)
*/
! Vector<String> pItems;
/**
* The index of the current choice for this <code>Choice</code>
* or -1 if nothing is selected.
* @serial
*** 127,137 ****
* @see #select(int)
* @see #select(java.lang.String)
*/
public Choice() throws HeadlessException {
GraphicsEnvironment.checkHeadless();
! pItems = new Vector();
}
/**
* Constructs a name for this component. Called by
* <code>getName</code> when the name is <code>null</code>.
--- 127,137 ----
* @see #select(int)
* @see #select(java.lang.String)
*/
public Choice() throws HeadlessException {
GraphicsEnvironment.checkHeadless();
! pItems = new Vector<>();
}
/**
* Constructs a name for this component. Called by
* <code>getName</code> when the name is <code>null</code>.
*** 189,199 ****
/*
* This is called by the native code, so client code can't
* be called on the toolkit thread.
*/
final String getItemImpl(int index) {
! return (String)pItems.elementAt(index);
}
/**
* Adds an item to this <code>Choice</code> menu.
* @param item the item to be added
--- 189,199 ----
/*
* This is called by the native code, so client code can't
* be called on the toolkit thread.
*/
final String getItemImpl(int index) {
! return pItems.elementAt(index);
}
/**
* Adds an item to this <code>Choice</code> menu.
* @param item the item to be added
*** 522,532 ****
* @see java.awt.event.ItemEvent
* @see java.awt.event.ItemListener
* @since 1.4
*/
public synchronized ItemListener[] getItemListeners() {
! return (ItemListener[])(getListeners(ItemListener.class));
}
/**
* Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s
--- 522,532 ----
* @see java.awt.event.ItemEvent
* @see java.awt.event.ItemListener
* @since 1.4
*/
public synchronized ItemListener[] getItemListeners() {
! return getListeners(ItemListener.class);
}
/**
* Returns an array of all the objects currently registered
* as <code><em>Foo</em>Listener</code>s