http://cookxml.sf.net/cookswing/

Tag <combobox>

All Ancestor Tags

<listeners> , <component>

Class

JComboBox

A component that combines a button or editable field and a drop-down list. The user can select a value from the drop-down list, which appears at the user's request. If you make the combo box editable, then the combo box includes an editable field into which the user can type a value.

For the keyboard keys used by this component in the standard Look and Feel (L&F) renditions, see the JComboBox key assignments.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}.

See How to Use Combo Boxes in The Java Tutorial for further information.


Attribute Summary
Attribute Type Description
action Action Sets the Action for the ActionEvent source.
actioncommand <text> Sets the action command that should be included in the event sent to action listeners.
actionmap ActionMap Sets the ActionMap to am.
alignmentx <float> Sets the the vertical alignment.
alignmenty <float> Sets the the horizontal alignment.
autoscrolls <boolean> Sets the autoscrolls property.
background <color> Sets the background color of this component.
border Border Sets the border of this component.
bounds <rectangle> Moves and resizes this component to conform to the new bounding rectangle r.
componentorientation ComponentOrientation Sets the language-sensitive orientation that is to be used to order the elements or text within this component.
cursor <cursor> Sets the cursor image to the specified cursor.
debuggraphicsoptions <int> Enables or disables diagnostic information about every graphics operation performed within the component or one of its children.
defaultlocale <locale> Sets the default locale used to initialize each JComponent's locale property upon creation.
doublebuffered <boolean> Sets whether the this component should use a buffer to paint.
droptarget DropTarget Associate a DropTarget with this component.
editable <boolean> Determines whether the JComboBox field is editable.
editor ComboBoxEditor Sets the editor used to paint and edit the selected item in the JComboBox field.
enabled <boolean> Enables the combo box so that items can be selected.
focusable <boolean> Sets the focusable state of this Component to the specified value.
focuscycleroot <boolean> Sets whether this Container is the root of a focus traversal cycle.
focustraversalkeysenabled <boolean> Sets whether focus traversal keys are enabled for this Component.
focustraversalpolicy FocusTraversalPolicy Sets the focus traversal policy that will manage keyboard traversal of this Container's children, if this Container is a focus cycle root.
font <font> Sets the font for this component.
foreground <color> Sets the foreground color of this component.
ignorerepaint <boolean> Sets whether or not paint messages received from the operating system should be ignored.
inputverifier InputVerifier Sets the input verifier for this component.
keyselectionmanager JComboBox$KeySelectionManager
layout LayoutManager Sets the layout manager for this container.
lightweightpopupenabled <boolean> 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.
locale <locale> Sets the locale of this component.
location <point> Moves this component to a new location.
maximumrowcount <int> Sets the maximum number of rows the JComboBox displays.
maximumsize <dimension> Sets the maximum size of this component to a constant value.
minimumsize <dimension> Sets the minimum size of this component to a constant value.
model ComboBoxModel Sets the data model that the JComboBox uses to obtain the list of items.
name <text> Sets the name of the component to the specified string.
nextfocusablecomponent Component Overrides the default FocusTraversalPolicy for this JComponent's focus traversal cycle by unconditionally setting the specified Component as the next Component in the cycle, and this JComponent as the specified Component's previous Component in the cycle.
opaque <boolean> If true the component paints every pixel within its bounds.
popupvisible <boolean> Sets the visibility of the popup.
preferredsize <dimension> Sets the preferred size of this component.
prototypedisplayvalue <object> Sets the prototype display value used to calculate the size of the display for the UI portion.
renderer ListCellRenderer Sets the renderer that paints the list items and the item selected from the list in the JComboBox field.
requestfocusenabled <boolean> Provides a hint as to whether or not this JComponent should get focus.
selectedindex <int> Selects the item at index anIndex.
selecteditem <object> Sets the selected item in the combo box display area to the object in the argument.
size <dimension> Resizes this component so that it has width d.width and height d.height.
tooltiptext <text> Registers the text to display in a tool tip.
transferhandler TransferHandler Sets the transferHandler property, which is null if the component does not support data transfer operations.
ui ComboBoxUI Sets the L&F object that renders this component.
verifyinputwhenfocustarget <boolean> Sets the value to indicate whether input verifier for the current focus owner will be called before this component requests focus.
visible <boolean> Makes the component visible or invisible.