JColorChooser
provides a pane of controls designed to allow a user to manipulate and select a color. For information about using color choosers, see
How to Use Color Choosers , a section in
The Java Tutorial .
This class provides three levels of API:
- A static convenience method which shows a modal color-chooser dialog and returns the color selected by the user.
- A static convenience method for creating a color-chooser dialog where
ActionListeners
can be specified to be invoked when the user presses one of the dialog buttons.
- The ability to create instances of
JColorChooser
panes directly (within any container). PropertyChange
listeners can be added to detect when the current "color" property changes.
Warning: Swing is not thread safe. For more information see Swing's Threading Policy .
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 JavaBeans™ has been added to the java.beans
package. Please see XMLEncoder
.