|
|||||||||
| Home >> All >> javax >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.swing
Class JComboBox

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JComboBox
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, javax.swing.event.ListDataListener, java.awt.MenuContainer, java.io.Serializable
- public class JComboBox
- extends JComponent
- implements java.awt.ItemSelectable, javax.swing.event.ListDataListener, java.awt.event.ActionListener, javax.accessibility.Accessible
- extends JComponent
A component that allows a user to select any item in its list and displays the selected item to the user. JComboBox also can show/hide a popup menu containing its list of item whenever the mouse is pressed over it.
| Nested Class Summary | |
protected class |
JComboBox.AccessibleJComboBox
Accessibility support for JComboBox. |
static interface |
JComboBox.KeySelectionManager
Classes implementing this interface are responsible for matching key characters typed by the user with combo box's items. |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private Action |
action
The action taken when new item is selected in the JComboBox |
protected java.lang.String |
actionCommand
This actionCommand is used in ActionEvent that is fired to JComboBox's ActionListeneres. |
protected ComboBoxModel |
dataModel
Data model used by JComboBox to keep track of its list data and currently selected element in the list. |
private static int |
DEFAULT_MAXIMUM_ROW_COUNT
Maximum number of rows that should be visible by default in the JComboBox's popup |
protected ComboBoxEditor |
editor
Editor that is responsible for editing an object in a combo box list. |
protected boolean |
isEditable
This field indicates if textfield of this JComboBox is editable or not. |
protected JComboBox.KeySelectionManager |
keySelectionManager
keySelectionManager |
protected boolean |
lightWeightPopupEnabled
This property indicates if heavyweight popup or lightweight popup will be used to diplay JComboBox's elements. |
protected int |
maximumRowCount
Number of rows that will be visible in the JComboBox's popup. |
private java.lang.Object |
prototypeDisplayValue
since 1.4 If this field is set then comboBox's display area for the selected item will be set by default to this value. |
protected ListCellRenderer |
renderer
Renderer renders(paints) every object in the combo box list in its associated list cell. |
protected java.lang.Object |
selectedItemReminder
This field is reference to the current selection of the combo box. |
private static long |
serialVersionUID
|
| Fields inherited from class javax.swing.JComponent |
accessibleContext, alignmentX, alignmentY, autoscrolls, border, debugGraphicsOptions, doubleBuffered, isCompletelyDirty, isPaintingDoubleBuffered, listenerList, maximumSize, minimumSize, opaque, preferredSize, requestFocusEnabled, TOOL_TIP_TEXT_KEY, toolTipText, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JComboBox()
Constructor. |
|
JComboBox(ComboBoxModel model)
Constructs JComboBox object with specified data model for it. |
|
JComboBox(java.lang.Object[] itemArray)
Constructs JComboBox with specified list of items. |
|
JComboBox(java.util.Vector itemVector)
Constructs JComboBox object with specified list of items. |
|
| Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
This method handles actionEvents fired by the ComboBoxEditor. |
void |
addActionListener(java.awt.event.ActionListener listener)
This methods adds specified ActionListener to this JComboBox. |
void |
addItem(java.lang.Object element)
This method adds given element to this JComboBox. |
void |
addItemListener(java.awt.event.ItemListener listener)
This method registers given ItemListener with this JComboBox |
void |
addPopupMenuListener(javax.swing.event.PopupMenuListener listener)
Adds PopupMenuListener to combo box to listen to the events fired by the combo box's popup menu containing its list of items |
void |
configureEditor(ComboBoxEditor anEditor,
java.lang.Object anItem)
This method initializes specified ComboBoxEditor to display given item. |
protected void |
configurePropertiesFromAction(Action a)
Configure properties of the JComboBox by reading properties of specified action. |
void |
contentsChanged(javax.swing.event.ListDataEvent event)
The part of implementation of ListDataListener interface. |
protected java.beans.PropertyChangeListener |
createActionPropertyChangeListener(Action action)
Creates PropertyChangeListener to listen for the changes in comboBox's action properties. |
protected JComboBox.KeySelectionManager |
createDefaultKeySelectionManager()
createDefaultKeySelectionManager |
protected void |
fireActionEvent()
This method fires ActionEvent to this JComboBox's registered ActionListeners. |
protected void |
fireItemStateChanged(java.awt.event.ItemEvent e)
This method fires ItemEvent to this JComboBox's registered ItemListeners. |
void |
firePopupMenuCanceled()
Fires a popupMenuCanceled() event to all PopupMenuListeners. |
void |
firePopupMenuWillBecomeInvisible()
Fires a popupMenuWillBecomeInvisible() event to all PopupMenuListeners. |
void |
firePopupMenuWillBecomeVisible()
Fires a popupMenuWillBecomeVisible() event to all PopupMenuListeners. |
javax.accessibility.AccessibleContext |
getAccessibleContext()
Returns the object that provides accessibility features for this JComboBox component. |
Action |
getAction()
This method returns Action that is invoked when selected item is changed in the JComboBox. |
java.lang.String |
getActionCommand()
Returns actionCommand associated with the ActionEvent fired by the JComboBox to its registered ActionListeners. |
java.awt.event.ActionListener[] |
getActionListeners()
This method returns array of ActionListeners that are registered with this JComboBox. |
ComboBoxEditor |
getEditor()
Returns editor component that is responsible for displaying/editing selected item in the combo box. |
java.lang.Object |
getItemAt(int index)
Returns elements located in the combo box at the given index. |
int |
getItemCount()
This method returns number of elements in this JComboBox |
java.awt.event.ItemListener[] |
getItemListeners()
This method returns array of ItemListeners that are registered with this JComboBox. |
JComboBox.KeySelectionManager |
getKeySelectionManager()
getKeySelectionManager |
int |
getMaximumRowCount()
This method returns number of rows visible in the JComboBox's list of items. |
ComboBoxModel |
getModel()
This method returns data model for this comboBox. |
javax.swing.event.PopupMenuListener[] |
getPopupMenuListeners()
Returns array of PopupMenuListeners that are registered with combo box. |
java.lang.Object |
getPrototypeDisplayValue()
Returns an object that is used as the display value when calculating the preferred size for the combo box. |
ListCellRenderer |
getRenderer()
This method returns renderer responsible for rendering selected item in the combo box |
int |
getSelectedIndex()
Returns index of the item that is currently selected in the combo box. |
java.lang.Object |
getSelectedItem()
Returns currently selected item in the combo box. |
java.lang.Object[] |
getSelectedObjects()
Returns Object array of size 1 containing currently selected element in the JComboBox. |
javax.swing.plaf.ComboBoxUI |
getUI()
This method returns the UI used to display the JComboBox. |
java.lang.String |
getUIClassID()
This method returns the String identifier for the UI class to the used with the JComboBox. |
void |
hidePopup()
This method hides popup containing list of combo box's items |
void |
insertItemAt(java.lang.Object element,
int index)
Inserts given element at the specified index to this JComboBox. |
protected void |
installAncestorListener()
|
void |
intervalAdded(javax.swing.event.ListDataEvent event)
The part of implementation of ListDataListener interface. |
void |
intervalRemoved(javax.swing.event.ListDataEvent event)
The part of implementation of ListDataListener interface. |
boolean |
isEditable()
This method returns true JComboBox is editable and false otherwise |
boolean |
isLightWeightPopupEnabled()
This method returns whether popup menu that is used to display list of combo box's item is lightWeight or not. |
boolean |
isPopupVisible()
Checks if popup is currently visible on the screen. |
protected java.lang.String |
paramString()
Returns an implementation-dependent string describing the attributes of this JComboBox. |
void |
processKeyEvent(java.awt.event.KeyEvent e)
This method hides combo box's popup whenever TAB key is pressed. |
void |
removeActionListener(java.awt.event.ActionListener listener)
This method removes specified ActionListener from this JComboBox. |
void |
removeAllItems()
This method removes all elements from this JComboBox. |
void |
removeItem(java.lang.Object element)
This method removes given element from this JComboBox. |
void |
removeItemAt(int index)
This method remove element location in the specified index in the JComboBox. |
void |
removeItemListener(java.awt.event.ItemListener listener)
This method unregisters given ItemListener from this JComboBox |
void |
removePopupMenuListener(javax.swing.event.PopupMenuListener listener)
Removes PopupMenuListener to combo box to listen to the events fired by the combo box's popup menu containing its list of items |
protected void |
selectedItemChanged()
This method is invoked whenever selected item changes in the combo box's data model. |
boolean |
selectWithKeyChar(char keyChar)
This method selects item in this combo box that matches specified specified keyChar and returns true if such item is found. |
void |
setAction(Action a)
setAction |
void |
setActionCommand(java.lang.String aCommand)
This method sets actionCommand to the specified string. |
void |
setEditable(boolean editable)
This method sets editability of the combo box. |
void |
setEditor(ComboBoxEditor newEditor)
Sets editor for this JComboBox |
void |
setEnabled(boolean enabled)
This method disables or enables JComboBox. |
void |
setKeySelectionManager(JComboBox.KeySelectionManager aManager)
setKeySelectionManager |
void |
setLightWeightPopupEnabled(boolean enabled)
This method sets JComboBox's popup to be either lightweight or heavyweight. |
void |
setMaximumRowCount(int rowCount)
Sets number of rows that should be visible in this JComboBox's popup. |
void |
setModel(ComboBoxModel newDataModel)
Set the data model for this JComboBox. |
void |
setPopupVisible(boolean visible)
This method either displayes or hides the popup containing list of combo box's items. |
void |
setPrototypeDisplayValue(java.lang.Object value)
Sets the object that is assumed to be the displayed item when calculating the preferred size for the combo box. |
void |
setRenderer(ListCellRenderer aRenderer)
This method sets cell renderer for this JComboBox that will be used to paint combo box's items. |
void |
setSelectedIndex(int index)
Forces JComboBox to select component located in the given index in the combo box. |
void |
setSelectedItem(java.lang.Object item)
Forces combo box to select given item |
void |
setUI(javax.swing.plaf.ComboBoxUI ui)
Set the "UI" property of the combo box, which is a look and feel class responsible for handling comboBox's input events and painting it. |
void |
showPopup()
This method displays popup with list of combo box's items on the screen |
void |
updateUI()
This method sets this comboBox's UI to the UIManager's default for the current look and feel. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
DEFAULT_MAXIMUM_ROW_COUNT
private static final int DEFAULT_MAXIMUM_ROW_COUNT
- Maximum number of rows that should be visible by default in the
JComboBox's popup
- See Also:
- Constant Field Values
dataModel
protected ComboBoxModel dataModel
- Data model used by JComboBox to keep track of its list data and currently
selected element in the list.
renderer
protected ListCellRenderer renderer
- Renderer renders(paints) every object in the combo box list in its
associated list cell. This ListCellRenderer is used only when this
JComboBox is uneditable.
editor
protected ComboBoxEditor editor
- Editor that is responsible for editing an object in a combo box list.
maximumRowCount
protected int maximumRowCount
- Number of rows that will be visible in the JComboBox's popup.
isEditable
protected boolean isEditable
- This field indicates if textfield of this JComboBox is editable or not.
selectedItemReminder
protected java.lang.Object selectedItemReminder
- This field is reference to the current selection of the combo box.
keySelectionManager
protected JComboBox.KeySelectionManager keySelectionManager
- keySelectionManager
actionCommand
protected java.lang.String actionCommand
- This actionCommand is used in ActionEvent that is fired to JComboBox's
ActionListeneres.
lightWeightPopupEnabled
protected boolean lightWeightPopupEnabled
- This property indicates if heavyweight popup or lightweight popup will be
used to diplay JComboBox's elements.
action
private Action action
- The action taken when new item is selected in the JComboBox
prototypeDisplayValue
private java.lang.Object prototypeDisplayValue
- since 1.4 If this field is set then comboBox's display area for the
selected item will be set by default to this value.
| Constructor Detail |
JComboBox
public JComboBox(ComboBoxModel model)
- Constructs JComboBox object with specified data model for it.
Note that the JComboBox will not change the value that is preselected by your ComboBoxModel implementation.
JComboBox
public JComboBox(java.lang.Object[] itemArray)
- Constructs JComboBox with specified list of items.
JComboBox
public JComboBox(java.util.Vector itemVector)
- Constructs JComboBox object with specified list of items.
JComboBox
public JComboBox()
- Constructor. Creates new empty JComboBox. ComboBox's data model is set to
DefaultComboBoxModel.
| Method Detail |
isEditable
public boolean isEditable()
- This method returns true JComboBox is editable and false otherwise
installAncestorListener
protected void installAncestorListener()
setUI
public void setUI(javax.swing.plaf.ComboBoxUI ui)
- Set the "UI" property of the combo box, which is a look and feel class
responsible for handling comboBox's input events and painting it.
updateUI
public void updateUI()
- This method sets this comboBox's UI to the UIManager's default for the
current look and feel.
- Overrides:
updateUIin classJComponent
getUIClassID
public java.lang.String getUIClassID()
- This method returns the String identifier for the UI class to the used
with the JComboBox.
- Overrides:
getUIClassIDin classJComponent
getUI
public javax.swing.plaf.ComboBoxUI getUI()
- This method returns the UI used to display the JComboBox.
setModel
public void setModel(ComboBoxModel newDataModel)
- Set the data model for this JComboBox. This un-registers all listeners
associated with the current model, and re-registers them with the new
model.
getModel
public ComboBoxModel getModel()
- This method returns data model for this comboBox.
setLightWeightPopupEnabled
public void setLightWeightPopupEnabled(boolean enabled)
- This method sets JComboBox's popup to be either lightweight or
heavyweight. If 'enabled' is true then lightweight popup is used and
heavyweight otherwise. By default lightweight popup is used to display
this JComboBox's elements.
isLightWeightPopupEnabled
public boolean isLightWeightPopupEnabled()
- This method returns whether popup menu that is used to display list of
combo box's item is lightWeight or not.
setEditable
public void setEditable(boolean editable)
- This method sets editability of the combo box. If combo box is editable
the user can choose component from the combo box list by typing
component's name in the editor(JTextfield by default). Otherwise if not
editable, the user should use the list to choose the component. This
method fires PropertyChangeEvents to JComboBox's registered
PropertyChangeListeners to indicate that 'editable' property of the
JComboBox has changed.
setMaximumRowCount
public void setMaximumRowCount(int rowCount)
- Sets number of rows that should be visible in this JComboBox's popup. If
this JComboBox's popup has more elements that maximum number or rows
then popup will have a scroll pane to allow users to view other
elements.
getMaximumRowCount
public int getMaximumRowCount()
- This method returns number of rows visible in the JComboBox's list of
items.
setRenderer
public void setRenderer(ListCellRenderer aRenderer)
- This method sets cell renderer for this JComboBox that will be used to
paint combo box's items. The Renderer should only be used only when
JComboBox is not editable. In the case when JComboBox is editable the
editor must be used. This method also fires PropertyChangeEvent when
cellRendered for this JComboBox has changed.
getRenderer
public ListCellRenderer getRenderer()
- This method returns renderer responsible for rendering selected item in
the combo box
setEditor
public void setEditor(ComboBoxEditor newEditor)
- Sets editor for this JComboBox
getEditor
public ComboBoxEditor getEditor()
- Returns editor component that is responsible for displaying/editing
selected item in the combo box.
setSelectedItem
public void setSelectedItem(java.lang.Object item)
- Forces combo box to select given item
getSelectedItem
public java.lang.Object getSelectedItem()
- Returns currently selected item in the combo box.
The result may be
nullto indicate that nothing is currently selected.
setSelectedIndex
public void setSelectedIndex(int index)
- Forces JComboBox to select component located in the given index in the
combo box.
If the index is below -1 or exceeds the upper bound an
IllegalArgumentExceptionis thrown.If the index is -1 then no item gets selected.
getSelectedIndex
public int getSelectedIndex()
- Returns index of the item that is currently selected in the combo box. If
no item is currently selected, then -1 is returned.
Note: For performance reasons you should minimize invocation of this method. If the data model is not an instance of
DefaultComboBoxModelthe complexity is O(n) where n is the number of elements in the combo box.
getPrototypeDisplayValue
public java.lang.Object getPrototypeDisplayValue()
- Returns an object that is used as the display value when calculating the
preferred size for the combo box. This value is, of course, never
displayed anywhere.
- Since:
- 1.4
setPrototypeDisplayValue
public void setPrototypeDisplayValue(java.lang.Object value)
- Sets the object that is assumed to be the displayed item when calculating
the preferred size for the combo box. A java.beans.PropertyChangeEvent (with
the name
prototypeDisplayValue) is sent to all registered listeners.- Since:
- 1.4
addItem
public void addItem(java.lang.Object element)
- This method adds given element to this JComboBox.
A
RuntimeExceptionis thrown if the data model is not an instance of MutableComboBoxModel.
insertItemAt
public void insertItemAt(java.lang.Object element, int index)
- Inserts given element at the specified index to this JComboBox.
A
RuntimeExceptionis thrown if the data model is not an instance of MutableComboBoxModel.
removeItem
public void removeItem(java.lang.Object element)
- This method removes given element from this JComboBox.
A
RuntimeExceptionis thrown if the data model is not an instance of MutableComboBoxModel.
removeItemAt
public void removeItemAt(int index)
- This method remove element location in the specified index in the
JComboBox.
A
RuntimeExceptionis thrown if the data model is not an instance of MutableComboBoxModel.
removeAllItems
public void removeAllItems()
- This method removes all elements from this JComboBox.
A
RuntimeExceptionis thrown if the data model is not an instance of MutableComboBoxModel.
showPopup
public void showPopup()
- This method displays popup with list of combo box's items on the screen
hidePopup
public void hidePopup()
- This method hides popup containing list of combo box's items
setPopupVisible
public void setPopupVisible(boolean visible)
- This method either displayes or hides the popup containing list of combo
box's items.
isPopupVisible
public boolean isPopupVisible()
- Checks if popup is currently visible on the screen.
setActionCommand
public void setActionCommand(java.lang.String aCommand)
- This method sets actionCommand to the specified string. ActionEvent fired
to this JComboBox registered ActionListeners will contain this
actionCommand.
getActionCommand
public java.lang.String getActionCommand()
- Returns actionCommand associated with the ActionEvent fired by the
JComboBox to its registered ActionListeners.
setAction
public void setAction(Action a)
- setAction
getAction
public Action getAction()
- This method returns Action that is invoked when selected item is changed
in the JComboBox.
configurePropertiesFromAction
protected void configurePropertiesFromAction(Action a)
- Configure properties of the JComboBox by reading properties of specified
action. This method always sets the comboBox's "enabled" property to the
value of the Action's "enabled" property.
createActionPropertyChangeListener
protected java.beans.PropertyChangeListener createActionPropertyChangeListener(Action action)
- Creates PropertyChangeListener to listen for the changes in comboBox's
action properties.
fireItemStateChanged
protected void fireItemStateChanged(java.awt.event.ItemEvent e)
- This method fires ItemEvent to this JComboBox's registered ItemListeners.
This method is invoked when currently selected item in this combo box
has changed.
fireActionEvent
protected void fireActionEvent()
- This method fires ActionEvent to this JComboBox's registered
ActionListeners. This method is invoked when user explicitly changes
currently selected item.
firePopupMenuCanceled
public void firePopupMenuCanceled()
- Fires a popupMenuCanceled() event to all
PopupMenuListeners. Note: This method is intended for use by plaf classes only.
firePopupMenuWillBecomeInvisible
public void firePopupMenuWillBecomeInvisible()
- Fires a popupMenuWillBecomeInvisible() event to all
PopupMenuListeners. Note: This method is intended for use by plaf classes only.
firePopupMenuWillBecomeVisible
public void firePopupMenuWillBecomeVisible()
- Fires a popupMenuWillBecomeVisible() event to all
PopupMenuListeners. Note: This method is intended for use by plaf classes only.
selectedItemChanged
protected void selectedItemChanged()
- This method is invoked whenever selected item changes in the combo box's
data model. It fires ItemEvent and ActionEvent to all registered
ComboBox's ItemListeners and ActionListeners respectively, indicating
the change.
getSelectedObjects
public java.lang.Object[] getSelectedObjects()
- Returns Object array of size 1 containing currently selected element in
the JComboBox.
- Specified by:
getSelectedObjectsin interfacejava.awt.ItemSelectable
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- This method handles actionEvents fired by the ComboBoxEditor. It changes
this JComboBox's selection to the new value currently in the editor and
hides list of combo box items.
- Specified by:
actionPerformedin interfacejava.awt.event.ActionListener
selectWithKeyChar
public boolean selectWithKeyChar(char keyChar)
- This method selects item in this combo box that matches specified
specified keyChar and returns true if such item is found. Otherwise
false is returned.
intervalAdded
public void intervalAdded(javax.swing.event.ListDataEvent event)
- The part of implementation of ListDataListener interface. This method is
invoked when some items where added to the JComboBox's data model.
- Specified by:
intervalAddedin interfacejavax.swing.event.ListDataListener
intervalRemoved
public void intervalRemoved(javax.swing.event.ListDataEvent event)
- The part of implementation of ListDataListener interface. This method is
invoked when some items where removed from the JComboBox's data model.
- Specified by:
intervalRemovedin interfacejavax.swing.event.ListDataListener
contentsChanged
public void contentsChanged(javax.swing.event.ListDataEvent event)
- The part of implementation of ListDataListener interface. This method is
invoked when contents of the JComboBox's data model changed.
- Specified by:
contentsChangedin interfacejavax.swing.event.ListDataListener
setEnabled
public void setEnabled(boolean enabled)
- This method disables or enables JComboBox. If the JComboBox is enabled,
then user is able to make item choice, otherwise if JComboBox is
disabled then user is not able to make a selection.
- Overrides:
setEnabledin classJComponent
configureEditor
public void configureEditor(ComboBoxEditor anEditor, java.lang.Object anItem)
- This method initializes specified ComboBoxEditor to display given item.
processKeyEvent
public void processKeyEvent(java.awt.event.KeyEvent e)
- This method hides combo box's popup whenever TAB key is pressed.
- Overrides:
processKeyEventin classJComponent
setKeySelectionManager
public void setKeySelectionManager(JComboBox.KeySelectionManager aManager)
- setKeySelectionManager
getKeySelectionManager
public JComboBox.KeySelectionManager getKeySelectionManager()
- getKeySelectionManager
getItemCount
public int getItemCount()
- This method returns number of elements in this JComboBox
getItemAt
public java.lang.Object getItemAt(int index)
- Returns elements located in the combo box at the given index.
createDefaultKeySelectionManager
protected JComboBox.KeySelectionManager createDefaultKeySelectionManager()
- createDefaultKeySelectionManager
paramString
protected java.lang.String paramString()
- Returns an implementation-dependent string describing the attributes of
this
JComboBox.- Overrides:
paramStringin classJComponent
getAccessibleContext
public javax.accessibility.AccessibleContext getAccessibleContext()
- Returns the object that provides accessibility features for this
JComboBoxcomponent.- Specified by:
getAccessibleContextin interfacejavax.accessibility.Accessible- Overrides:
getAccessibleContextin classJComponent
addActionListener
public void addActionListener(java.awt.event.ActionListener listener)
- This methods adds specified ActionListener to this JComboBox.
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
- This method removes specified ActionListener from this JComboBox.
getActionListeners
public java.awt.event.ActionListener[] getActionListeners()
- This method returns array of ActionListeners that are registered with
this JComboBox.
- Since:
- 1.4
addItemListener
public void addItemListener(java.awt.event.ItemListener listener)
- This method registers given ItemListener with this JComboBox
- Specified by:
addItemListenerin interfacejava.awt.ItemSelectable
removeItemListener
public void removeItemListener(java.awt.event.ItemListener listener)
- This method unregisters given ItemListener from this JComboBox
- Specified by:
removeItemListenerin interfacejava.awt.ItemSelectable
getItemListeners
public java.awt.event.ItemListener[] getItemListeners()
- This method returns array of ItemListeners that are registered with this
JComboBox.
- Since:
- 1.4
addPopupMenuListener
public void addPopupMenuListener(javax.swing.event.PopupMenuListener listener)
- Adds PopupMenuListener to combo box to listen to the events fired by the
combo box's popup menu containing its list of items
removePopupMenuListener
public void removePopupMenuListener(javax.swing.event.PopupMenuListener listener)
- Removes PopupMenuListener to combo box to listen to the events fired by
the combo box's popup menu containing its list of items
getPopupMenuListeners
public javax.swing.event.PopupMenuListener[] getPopupMenuListeners()
- Returns array of PopupMenuListeners that are registered with combo box.
|
|||||||||
| Home >> All >> javax >> [ swing overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC