You are here:   HomeJava ProgrammingSwingshowInputDialog Java Swing Example
by Dinesh Thakur Category: Swing


import java.awt.BorderLayout;

import java.awt.Color;
import java.awt.Container;
import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JColorChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.colorchooser.DefaultColorSelectionModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
class JavaExampleColorChooser extends JFrame implements ChangeListener
     JLabel Lbl;
     JavaExampleColorChooser(String TTL)
        setLayout(new FlowLayout());
        Container Cntnr=getContentPane();
        Cntnr.setLayout(new BorderLayout());
        JColorChooser Chsr=new JColorChooser(Color.BLACK);
        Lbl=new JLabel("Select Color To Make The Change",JLabel.CENTER); 
        Lbl.setFont(new Font("Arial",Font.PLAIN, 30));
        public void stateChanged(ChangeEvent ee)
            DefaultColorSelectionModel Mdl=(DefaultColorSelectionModel)ee.getSource();
               public static void main(String[] aa)
                    new JavaExampleColorChooser("Java Color Chooser");

JColorChooser Java Example

Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.

What's New and Popular

Popular Article