Example usage for Java javax.swing JComboBox fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | isEditable This protected field is implementation specific. |
JComboBox(ComboBoxModel Creates a JComboBox that takes its items from an existing ComboBoxModel . | |
JComboBox(E[] items) Creates a JComboBox that contains the elements in the specified array. | |
JComboBox(Vector Creates a JComboBox that contains the elements in the specified Vector. | |
JComboBox() Creates a JComboBox with a default data model. |
void | addActionListener(ActionListener l) Adds an ActionListener . |
void | addAncestorListener(AncestorListener listener) Registers listener so that it will receive AncestorEvents when it or any of its ancestors move or are made visible or invisible. |
void | addFocusListener(FocusListener l) Adds the specified focus listener to receive focus events from this component when this component gains input focus. |
void | addItem(E item) Adds an item to the item list. |
void | addItemListener(ItemListener aListener) Adds an ItemListener . |
void | addKeyListener(KeyListener l) Adds the specified key listener to receive key events from this component. |
void | addPopupMenuListener(PopupMenuListener l) Adds a PopupMenu listener which will listen to notification messages from the popup portion of the combo box. |
void | firePopupMenuCanceled() Notifies PopupMenuListener s that the popup portion of the combo box has been canceled. |
void | firePopupMenuWillBecomeInvisible() Notifies PopupMenuListener s that the popup portion of the combo box has become invisible. |
void | firePopupMenuWillBecomeVisible() Notifies PopupMenuListener s that the popup portion of the combo box will become visible. |
AccessibleContext | getAccessibleContext() Gets the AccessibleContext associated with this JComboBox. |
Action | getAction() Returns the currently set Action for this ActionEvent source, or null if no Action is set. |
String | getActionCommand() Returns the action command that is included in the event sent to action listeners. |
ActionListener[] | getActionListeners() Returns an array of all the ActionListener s added to this JComboBox with addActionListener(). |
Rectangle | getBounds() Gets the bounds of this component in the form of a Rectangle object. |
Component[] | getComponents() Gets all the components in this container. |
ComboBoxEditor | getEditor() Returns the editor used to paint and edit the selected item in the JComboBox field. |
Font | getFont() Gets the font of this component. |
FontMetrics | getFontMetrics(Font font) Gets the FontMetrics for the specified Font . |
InputMap | getInputMap(int condition) Returns the InputMap that is used during condition . |
E | getItemAt(int index) Returns the list item at the specified index. |
int | getItemCount() Returns the number of items in the list. |
ItemListener[] | getItemListeners() Returns an array of all the ItemListener s added to this JComboBox with addItemListener(). |
KeyListener[] | getKeyListeners() Returns an array of all the key listeners registered on this component. |
KeySelectionManager | getKeySelectionManager() Returns the list's key-selection manager. |
int | getMaximumRowCount() Returns the maximum number of items the combo box can display without a scrollbar |
Dimension | getMinimumSize() If the minimum size has been set to a non- null value just returns it. |
ComboBoxModel | getModel() Returns the data model currently used by the JComboBox . |
String | getName() Gets the name of the component. |
Container | getParent() Gets the parent of this component. |
PopupMenuListener[] | getPopupMenuListeners() Returns an array of all the PopupMenuListener s added to this JComboBox with addPopupMenuListener(). |
Dimension | getPreferredSize() If the preferredSize has been set to a non-null value just returns it. |
E | getPrototypeDisplayValue() Returns the "prototypical display" value - an Object used for the calculation of the display height and width. |
ListCellRenderer super E> | getRenderer() Returns the renderer used to display the selected item in the JComboBox field. |
int | getSelectedIndex() Returns the first item in the list that matches the given item. |
Object | getSelectedItem() Returns the current selected item. |
Object[] | getSelectedObjects() Returns an array containing the selected item. |
Dimension | getSize() Returns the size of this component in the form of a Dimension object. |
ComboBoxUI | getUI() Returns the L&F object that renders this component. |
void | hidePopup() Causes the combo box to close its popup window. |
void | insertItemAt(E item, int index) Inserts an item into the item list at a given index. |
boolean | isDisplayable() Determines whether this component is displayable. |
boolean | isEnabled() Determines whether this component is enabled. |
boolean | isLightWeightPopupEnabled() Gets the value of the lightWeightPopupEnabled property. |
boolean | isPopupVisible() Determines the visibility of the popup. |
boolean | isShowing() Determines whether this component is showing on screen. |
boolean | isVisible() Determines whether this component should be visible when its parent is visible. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | removeActionListener(ActionListener l) Removes an ActionListener . |
void | removeAll() Removes all the components from this container. |
void | removeAllItems() Removes all items from the item list. |
void | removeItem(Object anObject) Removes an item from the item list. |
void | removeItemAt(int anIndex) Removes the item at anIndex This method works only if the JComboBox uses a mutable data model. |
void | removeItemListener(ItemListener aListener) Removes an ItemListener . |
void | removeKeyListener(KeyListener l) Removes the specified key listener so that it no longer receives key events from this component. |
void | repaint() Repaints this component. |
boolean | requestFocusInWindow() Requests that this Component gets the input focus. |
void | revalidate() Supports deferred automatic layout. |
void | setAction(Action a) Sets the Action for the ActionEvent source. |
void | setActionCommand(String aCommand) Sets the action command that should be included in the event sent to action listeners. |
void | setAlignmentX(float alignmentX) Sets the horizontal alignment. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBounds(int x, int y, int width, int height) Moves and resizes this component. |
void | setComponentOrientation(ComponentOrientation o) Sets the language-sensitive orientation that is to be used to order the elements or text within this component. |
void | setEditable(boolean aFlag) Determines whether the JComboBox field is editable. |
void | setEditor(ComboBoxEditor anEditor) Sets the editor used to paint and edit the selected item in the JComboBox field. |
void | setEnabled(boolean b) Enables the combo box so that items can be selected. |
void | setFocusable(boolean focusable) Sets the focusable state of this Component to the specified value. |
void | setFont(Font font) Sets the font for this component. |
void | setKeySelectionManager(KeySelectionManager aManager) Sets the object that translates a keyboard character into a list selection. |
void | setLightWeightPopupEnabled(boolean aFlag) Sets the lightWeightPopupEnabled property, which provides a hint as to whether or not a lightweight Component should be used to contain the JComboBox , versus a heavyweight Component such as a Panel or a Window . |
void | setMaximumRowCount(int count) Sets the maximum number of rows the JComboBox displays. |
void | setMaximumSize(Dimension maximumSize) Sets the maximum size of this component to a constant value. |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setModel(ComboBoxModel Sets the data model that the JComboBox uses to obtain the list of items. |
void | setName(String name) Sets the name of the component to the specified string. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setPopupVisible(boolean v) Sets the visibility of the popup. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setPrototypeDisplayValue(E prototypeDisplayValue) Sets the prototype display value used to calculate the size of the display for the UI portion. |
void | setRenderer(ListCellRenderer super E> aRenderer) Sets the renderer that paints the list items and the item selected from the list in the JComboBox field. |
void | setRequestFocusEnabled(boolean requestFocusEnabled) Provides a hint as to whether or not this JComponent should get focus. |
void | setSelectedIndex(int anIndex) Selects the item at index anIndex . |
void | setSelectedItem(Object anObject) Sets the selected item in the combo box display area to the object in the argument. |
void | setSize(Dimension d) Resizes this component so that it has width d.width and height d.height . |
void | setToolTipText(String text) Registers the text to display in a tool tip. |
void | setUI(ComboBoxUI ui) Sets the L&F object that renders this component. |
void | setVisible(boolean aFlag) Makes the component visible or invisible. |
void | showPopup() Causes the combo box to display its popup window. |
void | updateUI() Resets the UI property to a value from the current look and feel. |