All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.java.swing.JComboBox

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----com.sun.java.swing.JComponent
                           |
                           +----com.sun.java.swing.JComboBox

public class JComboBox
extends JComponent
implements ItemSelectable, ListDataListener, ActionListener

Variable Index

 o dataModel
 o editor
 o isEditable
 o keySelectionManager
 o maximumRowCount
 o renderer
 o selectedItemReminder

Constructor Index

 o JComboBox()
 o JComboBox(ComboBoxModel)

Method Index

 o actionPerformed(ActionEvent)
This method is public as an implementation side effect.
 o addItem(Object)
Add an item in the item list.
 o addItemListener(ItemListener)
Add an ItemListener.
 o configureEditor(ComboBoxEditor, Object)
 o contentsChanged(ListDataEvent)
This method is public as an implementation side effect.
 o createDefaultKeySelectionManager()
 o fireItemStateChanged(ItemEvent)
 o getEditor()
 o getItemAt(int)
 o getItemCount()
Accessing the model
 o getKeySelectionManager()
 o getMaximumRowCount()
 o getModel()
 o getRenderer()
 o getSelectedIndex()
 o getSelectedItem()
 o getSelectedObjects()
Return an array containing the selected item.
 o getUI()
 o getUIClassID()
 o hidePopup()
Causes the combo box to hide its popup
 o insertItemAt(Object, int)
Insert an item in the item list at a given index
 o intervalAdded(ListDataEvent)
 o intervalRemoved(ListDataEvent)
 o isEditable()
 o isFocusTraversable()
Identifies whether or not this component can receive the focus.
 o isOpaque()
Returns true if this component is completely opaque.
 o processKeyEvent(KeyEvent)
Override processKeyEvent to process events
 o removeAllItems()
Convenience to remove all items This method works only if the receiving JComboBox uses the default JComboBox data model.
 o removeItem(Object)
Remove an item from the item list.
 o removeItemAt(int)
Remove the item at anIndex
 o removeItemListener(ItemListener)
Remove an ItemListener
 o selectedItemChanged()
This method is called when the selected item changes.
 o selectWithKeyChar(char)
 o setEditable(boolean)
 o setEditor(ComboBoxEditor)
 o setEnabled(boolean)
 o setKeySelectionManager(JComboBox. KeySelectionManager)
 o setMaximumRowCount(int)
 o setModel(ComboBoxModel)
 o setRenderer(ListCellRenderer)
 o setSelectedIndex(int)
 o setSelectedItem(Object)
Set the receiving JComboBox selected item.
 o setUI(ComboBoxUI)
 o showPopup()
Causes the combo box to show its popup
 o updateUI()
Overriden from JComponent to change the UI according to the default factory

Variables

 o dataModel
 protected ComboBoxModel dataModel
 o renderer
 protected ListCellRenderer renderer
 o editor
 protected ComboBoxEditor editor
 o maximumRowCount
 protected int maximumRowCount
 o isEditable
 protected boolean isEditable
 o selectedItemReminder
 protected Object selectedItemReminder
 o keySelectionManager
 protected JComboBox. KeySelectionManager keySelectionManager

Constructors

 o JComboBox
 public JComboBox(ComboBoxModel aModel)
 o JComboBox
 public JComboBox()

Methods

 o setUI
 public void setUI(ComboBoxUI ui)
 o updateUI
 public void updateUI()
Overriden from JComponent to change the UI according to the default factory

Overrides:
updateUI in class JComponent
 o getUIClassID
 public String getUIClassID()
Returns:
"ComboBoxUI"
Overrides:
getUIClassID in class JComponent
See Also:
getUIClassID, getUI
 o getUI
 public ComboBoxUI getUI()
 o setModel
 public void setModel(ComboBoxModel aModel)
 o getModel
 public ComboBoxModel getModel()
 o setEditable
 public void setEditable(boolean aFlag)
 o isEditable
 public boolean isEditable()
 o setMaximumRowCount
 public void setMaximumRowCount(int count)
 o getMaximumRowCount
 public int getMaximumRowCount()
 o setRenderer
 public void setRenderer(ListCellRenderer aRenderer)
 o getRenderer
 public ListCellRenderer getRenderer()
 o setEditor
 public void setEditor(ComboBoxEditor anEditor)
 o getEditor
 public ComboBoxEditor getEditor()
 o 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

 o getSelectedItem
 public Object getSelectedItem()
 o setSelectedIndex
 public void setSelectedIndex(int anIndex)
 o getSelectedIndex
 public int getSelectedIndex()
 o 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.

 o insertItemAt
 public void insertItemAt(Object anObject,
                          int index)
Insert an item in the item list at a given index

 o 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.

 o removeItemAt
 public void removeItemAt(int anIndex)
Remove the item at anIndex

 o 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.

 o showPopup
 public void showPopup()
Causes the combo box to show its popup

 o hidePopup
 public void hidePopup()
Causes the combo box to hide its popup

 o addItemListener
 public void addItemListener(ItemListener aListener)
Add an ItemListener. aListener will receive an event when the selected item changes

 o removeItemListener
 public void removeItemListener(ItemListener aListener)
Remove an ItemListener

 o fireItemStateChanged
 protected void fireItemStateChanged(ItemEvent e)
 o selectedItemChanged
 protected void selectedItemChanged()
This method is called when the selected item changes. Its default implementation notifies the item listeners

 o getSelectedObjects
 public Object[] getSelectedObjects()
Return an array containing the selected item. This method is implemented for ItemSelectable compatibility reasons.

 o actionPerformed
 public void actionPerformed(ActionEvent e)
This method is public as an implementation side effect. do not call or override

 o contentsChanged
 public void contentsChanged(ListDataEvent e)
This method is public as an implementation side effect. do not call or override

 o selectWithKeyChar
 public boolean selectWithKeyChar(char keyChar)
 o intervalAdded
 public void intervalAdded(ListDataEvent e)
 o intervalRemoved
 public void intervalRemoved(ListDataEvent e)
 o setEnabled
 public void setEnabled(boolean b)
Overrides:
setEnabled in class Component
 o configureEditor
 public void configureEditor(ComboBoxEditor anEditor,
                             Object anItem)
 o processKeyEvent
 public void processKeyEvent(KeyEvent e)
Override processKeyEvent to process events

Overrides:
processKeyEvent in class JComponent
 o isFocusTraversable
 public boolean isFocusTraversable()
Identifies whether or not this component can receive the focus.

Overrides:
isFocusTraversable in class JComponent
 o setKeySelectionManager
 public void setKeySelectionManager(JComboBox. KeySelectionManager aManager)
 o getKeySelectionManager
 public JComboBox. KeySelectionManager getKeySelectionManager()
 o getItemCount
 public int getItemCount()
Accessing the model

 o getItemAt
 public Object getItemAt(int index)
 o createDefaultKeySelectionManager
 protected JComboBox. KeySelectionManager createDefaultKeySelectionManager()
 o 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