The JColorChooser Class
Properties
In addition to the typical UI properties of Swing components, the
color chooser has the following properties listed in Table 12.6. The chooserPanels property
contains an array of all the chooser panels currently associated with
this color chooser. You can get and set the entire array at once or,
more commonly, you can add and remove chooser panels using some of
the methods described later. The
color
property contains the currently
selected color in the chooser. The
previewPanel
property contains the
JComponent subclass that previews your color
choice. (You can see an example of the default preview panel in Figure 12.7.) The selectionModel
property dictates which selection model
the chooser uses.
Table 12-6. JColorChooser Properties
|
Property |
Data Type |
get |
is |
set |
bound |
Default Value |
|---|---|---|---|---|---|---|
| See also properties from the JComponent class (Table 3.5) | ||||||
|
|
|
• |
• |
• |
from L&F | |
|
|
|
• |
| |||
|
|
|
• |
• |
• |
| |
|
|
|
• |
| |||
|
|
|
• |
• |
• |
| |
|
|
|
• |
• |
| ||
|
|
|
• |
• |
• |
|
Events (Inherited from JComponent)
On its own, JColorChooser only supports
PropertyChangeEvents, like all ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access