Creating a Color Chooser Dialog - Java Swing

Java examples for Swing:JColorChooser

Description

Creating a Color Chooser Dialog

Demo Code

import java.awt.Color;

import javax.swing.JColorChooser;
import javax.swing.JFrame;

public class Main {

  public void main(String[] argv) {
    Color initialColor = Color.red;
    Color newColor = JColorChooser.showDialog(new JFrame(), "Dialog Title",
        initialColor);/*w ww  . j  a va  2s  .c  o  m*/
  }
}

Related Tutorials