FileDocCategorySizeDatePackage
ColorPicker.javaAPI DocExample890Thu Oct 24 20:14:24 BST 2002None

ColorPicker

public class ColorPicker extends JFrame

Fields Summary
Constructors Summary
public ColorPicker()

    super("JColorChooser Test Frame");
    setSize(200, 100);
    final Container contentPane = getContentPane();
    final JButton go = new JButton("Show JColorChooser");
    go.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Color c;
        c = JColorChooser.showDialog(
                  ((Component)e.getSource()).getParent(),
                  "Demo", Color.blue);
        contentPane.setBackground(c); 
      }
    });
    contentPane.add(go, BorderLayout.SOUTH);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
  
Methods Summary
public static voidmain(java.lang.String[] args)

    ColorPicker cp = new ColorPicker();
    cp.setVisible(true);