All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.swing.JComboBox
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.swing.JComponent
|
+----java.awt.swing.JComboBox
- public class JComboBox
- extends JComponent
- implements ItemSelectable, ListDataListener, ActionListener
JComboBox.KeySelectionManager-
actionCommand-
dataModel-
editor-
isEditable-
keySelectionManager-
maximumRowCount-
renderer-
selectedItemReminder-
JComboBox()
-
JComboBox(ComboBoxModel)
-
actionPerformed(ActionEvent)
- This method is public as an implementation side effect.
addActionListener(ActionListener)
- Add an ActionListener.
addItem(Object)
- Add an item in the item list.
addItemListener(ItemListener)
- Add an ItemListener.
configureEditor(ComboBoxEditor, Object)
-
contentsChanged(ListDataEvent)
- This method is public as an implementation side effect.
createDefaultKeySelectionManager()
-
fireActionEvent()
-
fireItemStateChanged(ItemEvent)
-
getActionCommand()
- Return the action commnand that is included into the event sent to
action listeners
getEditor()
-
getItemAt(int)
-
getItemCount()
- Accessing the model
getKeySelectionManager()
-
getMaximumRowCount()
-
getModel()
-
getRenderer()
-
getSelectedIndex()
-
getSelectedItem()
-
getSelectedObjects()
- Return an array containing the selected item.
getUI()
-
getUIClassID()
-
hidePopup()
- Causes the combo box to hide its popup
insertItemAt(Object, int)
- Insert an item in the item list at a given index
intervalAdded(ListDataEvent)
-
intervalRemoved(ListDataEvent)
-
isEditable()
-
isFocusTraversable()
- Identifies whether or not this component can receive the focus.
isOpaque()
- Returns true if this component is completely opaque.
processKeyEvent(KeyEvent)
- Override processKeyEvent to process events
removeActionListener(ActionListener)
- Remove an ActionListener
removeAllItems()
- Convenience to remove all items
This method works only if the receiving JComboBox uses the default JComboBox data model.
removeItem(Object)
- Remove an item from the item list.
removeItemAt(int)
- Remove the item at
anIndex
removeItemListener(ItemListener)
- Remove an ItemListener
selectedItemChanged()
- This method is called when the selected item changes.
selectWithKeyChar(char)
-
setActionCommand(String)
- Set the action commnand that should be included into the event
sent to action listeners
setEditable(boolean)
-
setEditor(ComboBoxEditor)
-
setEnabled(boolean)
- Enables or disables this component, depending on the value of the
parameter
b
.
setKeySelectionManager(JComboBox.KeySelectionManager)
-
setMaximumRowCount(int)
-
setModel(ComboBoxModel)
-
setRenderer(ListCellRenderer)
-
setSelectedIndex(int)
-
setSelectedItem(Object)
- Set the receiving JComboBox selected item.
setUI(ComboBoxUI)
-
showPopup()
- Causes the combo box to show its popup
updateUI()
- Overriden from JComponent to change the UI according to the default factory
dataModel
protected ComboBoxModel dataModel
renderer
protected ListCellRenderer renderer
editor
protected ComboBoxEditor editor
maximumRowCount
protected int maximumRowCount
isEditable
protected boolean isEditable
selectedItemReminder
protected Object selectedItemReminder
keySelectionManager
protected JComboBox.KeySelectionManager keySelectionManager
actionCommand
protected String actionCommand
JComboBox
public JComboBox(ComboBoxModel aModel)
JComboBox
public JComboBox()
setUI
public void setUI(ComboBoxUI ui)
updateUI
public void updateUI()
- Overriden from JComponent to change the UI according to the default factory
- Overrides:
- updateUI in class JComponent
getUIClassID
public String getUIClassID()
- Returns:
- "ComboBoxUI"
- Overrides:
- getUIClassID in class JComponent
- See Also:
- getUIClassID, getUI
getUI
public ComboBoxUI getUI()
setModel
public void setModel(ComboBoxModel aModel)
getModel
public ComboBoxModel getModel()
setEditable
public void setEditable(boolean aFlag)
isEditable
public boolean isEditable()
setMaximumRowCount
public void setMaximumRowCount(int count)
getMaximumRowCount
public int getMaximumRowCount()
setRenderer
public void setRenderer(ListCellRenderer aRenderer)
getRenderer
public ListCellRenderer getRenderer()
setEditor
public void setEditor(ComboBoxEditor anEditor)
getEditor
public ComboBoxEditor getEditor()
setSelectedItem
public void setSelectedItem(Object anObject)
- Set the receiving JComboBox selected item. If anObject is in the list of items
the list will display anObject selected
getSelectedItem
public Object getSelectedItem()
setSelectedIndex
public void setSelectedIndex(int anIndex)
getSelectedIndex
public int getSelectedIndex()
addItem
public void addItem(Object anObject)
- Add an item in the item list.
This method works only if the receiving JComboBox uses the default JComboBox data model.
JComboBox uses the default JComboBox data model when created with the empty constructor
and no other model has been set.
insertItemAt
public void insertItemAt(Object anObject,
int index)
- Insert an item in the item list at a given index
removeItem
public void removeItem(Object anObject)
- Remove an item from the item list.
This method works only if the receiving JComboBox uses the default JComboBox data model.
JComboBox uses the default JComboBox data model when created with the empty constructor
and no other model has been set.
removeItemAt
public void removeItemAt(int anIndex)
- Remove the item at
anIndex
removeAllItems
public void removeAllItems()
- Convenience to remove all items
This method works only if the receiving JComboBox uses the default JComboBox data model.
JComboBox uses the default JComboBox data model when created with the empty constructor
and no other model has been set.
showPopup
public void showPopup()
- Causes the combo box to show its popup
hidePopup
public void hidePopup()
- Causes the combo box to hide its popup
addItemListener
public void addItemListener(ItemListener aListener)
- Add an ItemListener.
aListener
will receive an event when
the selected item changes
removeItemListener
public void removeItemListener(ItemListener aListener)
- Remove an ItemListener
addActionListener
public void addActionListener(ActionListener l)
- Add an ActionListener. The listener will receive an action event
when the selected item changes
removeActionListener
public void removeActionListener(ActionListener l)
- Remove an ActionListener
setActionCommand
public void setActionCommand(String aCommand)
- Set the action commnand that should be included into the event
sent to action listeners
getActionCommand
public String getActionCommand()
- Return the action commnand that is included into the event sent to
action listeners
fireItemStateChanged
protected void fireItemStateChanged(ItemEvent e)
fireActionEvent
protected void fireActionEvent()
selectedItemChanged
protected void selectedItemChanged()
- This method is called when the selected item changes. Its default implementation
notifies the item listeners
getSelectedObjects
public Object[] getSelectedObjects()
- Return an array containing the selected item. This method is implemented for
ItemSelectable compatibility reasons.
actionPerformed
public void actionPerformed(ActionEvent e)
- This method is public as an implementation side effect.
do not call or override
contentsChanged
public void contentsChanged(ListDataEvent e)
- This method is public as an implementation side effect.
do not call or override
selectWithKeyChar
public boolean selectWithKeyChar(char keyChar)
intervalAdded
public void intervalAdded(ListDataEvent e)
intervalRemoved
public void intervalRemoved(ListDataEvent e)
setEnabled
public void setEnabled(boolean b)
- Enables or disables this component, depending on the value of the
parameter
b
.
- Overrides:
- setEnabled in class Component
configureEditor
public void configureEditor(ComboBoxEditor anEditor,
Object anItem)
processKeyEvent
public void processKeyEvent(KeyEvent e)
- Override processKeyEvent to process events
- Overrides:
- processKeyEvent in class JComponent
isFocusTraversable
public boolean isFocusTraversable()
- Identifies whether or not this component can receive the focus.
- Overrides:
- isFocusTraversable in class JComponent
setKeySelectionManager
public void setKeySelectionManager(JComboBox.KeySelectionManager aManager)
getKeySelectionManager
public JComboBox.KeySelectionManager getKeySelectionManager()
getItemCount
public int getItemCount()
- Accessing the model
getItemAt
public Object getItemAt(int index)
createDefaultKeySelectionManager
protected JComboBox.KeySelectionManager createDefaultKeySelectionManager()
isOpaque
public boolean isOpaque()
- Returns true if this component is completely opaque.
- Overrides:
- isOpaque in class JComponent
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature