import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
class Win extends JFrame implements ActionListener
{
JButton jButton1;
    public Win()
    {
        setLayout(null);
        setTitle("ɫԻ");
        jButton1 = new JButton("ɫԻ");
        jButton1.setBounds(32, 45, 130, 34);
        jButton1.addActionListener(this);
        add(jButton1);
        setBounds(200, 200, 200, 150);
        validate();
        setVisible(true);
    }
    public void actionPerformed(ActionEvent e)
    {
        Color newColor = JColorChooser.showDialog(this, "ɫ",jButton1.getBackground());
        jButton1.setBackground(newColor);
    }
}
class ColorshowDialog_Test_jButton1_actionAdapter
{
public static void main(String args[])
{
        Win ta = new Win();
    }
}
