public class ChangingComboBoxModel<E> extends DefaultComboBoxModel<E>
ChangeListeners
and ActionListeners of changes in the selection.listenerList| Constructor and Description |
|---|
ChangingComboBoxModel()
Constructs an empty model.
|
ChangingComboBoxModel(Collection<E> items)
Constructs a model with a given initial list of items.
|
ChangingComboBoxModel(E[] items)
Constructs a model with a given initial array of items.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addActionListener(ActionListener listener)
Adds a listener which is notified whenever the selection changes.
|
void |
addChangeListener(ChangeListener listener)
Adds a listener which is notified whenever the selection changes.
|
protected void |
fireActionPerformed(Object source)
Called to notify listeners of a change.
|
protected void |
fireSelectionChanged(Object source)
Called to notify listeners of a change.
|
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by
addActionListener(java.awt.event.ActionListener). |
void |
removeChangeListener(ChangeListener listener)
Removes a listener previously added by
addChangeListener(javax.swing.event.ChangeListener). |
void |
setSelectedItem(Object item) |
addElement, getElementAt, getIndexOf, getSelectedItem, getSize, insertElementAt, removeAllElements, removeElement, removeElementAtaddListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddListDataListener, removeListDataListenerpublic ChangingComboBoxModel()
public ChangingComboBoxModel(E[] items)
items - initial list of items in the modelpublic ChangingComboBoxModel(Collection<E> items)
items - initial list of items in the modelpublic void addChangeListener(ChangeListener listener)
listener - listener to addpublic void removeChangeListener(ChangeListener listener)
addChangeListener(javax.swing.event.ChangeListener).listener - listener to removepublic void addActionListener(ActionListener listener)
listener - listener to addpublic void removeActionListener(ActionListener listener)
addActionListener(java.awt.event.ActionListener).listener - listener to removepublic void setSelectedItem(Object item)
setSelectedItem in interface ComboBoxModel<E>setSelectedItem in class DefaultComboBoxModel<E>protected void fireSelectionChanged(Object source)
source - change sourceprotected void fireActionPerformed(Object source)
source - change sourceCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.