Java Reference
In-Depth Information
The available set of UIResource -related properties for a JComboBox is shown in Table 13-11.
The JComboBox component has 21 different properties.
Table 13-11. JComboBox UIResource Elements
Property String
Object Type
ComboBox.actionMap
ActionMap
ComboBox.ancestorInputMap
InputMap
ComboBox.background
Color
ComboBox.border
Border
ComboBox.buttonBackground
Color
ComboBox.buttonDarkShadow
Color
ComboBox.buttonHighlight
Color
ComboBox.buttonShadow
Color
ComboBox.control
Color
ComboBox.controlForeground
Color
ComboBox.disabledBackground
Color
ComboBox.disabledForeground
Color
ComboBox.font
Font
ComboBox.foreground
Color
ComboBox.rendererUseListColors
Boolean
ComboBox.selectionBackground
Color
ComboBox.selectionForeground
Color
ComboBox.showPopupOnNavigation
Boolean
ComboBox.timeFactor
Long
ComboBox.togglePopupText
String
ComboBoxUI
String
Changing the pop-up icon is one example of customizing the look and feel. To do this,
you'll need to install a new user interface. (This process is discussed at length in Chapter 20.)
Basically, you inherit the default functionality from either the BasicComboBoxUI or MetalComboBoxUI
user interface delegate, and then override only the protected JButton createArrowButton()
method.
Figure 13-20 shows the results of this change to the JComboBox user interface.
Search WWH ::




Custom Search