Javatpoint Logo
Javatpoint Logo

Java JColorChooser

The JColorChooser class is used to create a color chooser dialog box so that user can select any color. It inherits JComponent class.

JColorChooser class declaration

Let's see the declaration for javax.swing.JColorChooser class.

Commonly used Constructors:

Constructor Description
JColorChooser() It is used to create a color chooser panel with white color initially.
JColorChooser(color initialcolor) It is used to create a color chooser panel with the specified color initially.

Commonly used Methods:

Method Description
void addChooserPanel(AbstractColorChooserPanel panel) It is used to add a color chooser panel to the color chooser.
static Color showDialog(Component c, String title, Color initialColor) It is used to show the color chooser dialog box.

Java JColorChooser Example


JAVA Jcolorchooser 1

Java JColorChooser Example with ActionListener


JAVA Jcolorchooser 2 JAVA Jcolorchooser 3
Next TopicJava JTabbedPane

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA