Java Reference
In-Depth Information
The available set of UIResource -related properties for a JToggleButton is shown in Table 5-2.
The JToggleButton component has 17 different properties.
Table 5-2. JToggleButton UIResource Elements
Property String
Object Type
ToggleButton.background
Color
ToggleButton.border
Border
ToggleButton.darkShadow
Color
ToggleButton.disabledText
Color
ToggleButton.focus
Color
ToggleButton.focusInputMap
Object[ ]
ToggleButton.font
Font
ToggleButton.foreground
Color
ToggleButton.gradient
List
ToggleButton.highlight
Color
ToggleButton.light
Color
ToggleButton.margin
Insets
ToggleButton.select
Color
ToggleButton.shadow
Color
ToggleButton.textIconGap
Integer
ToggleButton.textShiftOffset
Integer
ToggleButtonUI
String
JCheckBox Class
The JCheckBox class represents the toggle component that, by default, displays a check box
icon next to the text label for a two-state option. The check box icon uses an optional check
mark to show the current state of the object, instead of keeping the button depressed, as with
the JToggleButton . With the JCheckBox , the icon shows the state of the object, whereas with the
JToggleButton , the icon is part of the label and isn't usually used to show state information.
With the exception of the UI-related differences between JCheckBox and JToggleButton , the
two components are identical. Figure 5-5 demonstrates how check box components might
appear in a pizza-ordering application.
Search WWH ::




Custom Search