[求助]这个程序错在那?我是新手
import java.awt.*;import java.awt.event.*;
import javax.swing.*;
public class text extends JFrame implements ActionListener
{
int red,green,blue;
JPanel p =new JPanel();
JButton b = new JButton("按键");
public text()
{
this.add(p);
p.add(b);
b.addActionListener(this);
this.setVisible(true);
this.setSize(300,200);
this.setDefaultCloseOperation(this.EXIT_ON_CLOSE);
}
public void actionperformed(ActionEvent e)
{
red = (int)(Math.random()*256);
green = (int)(Math.random()*256);
blue = (int)(Math.random()*256);
p.setBackground(new Color(red,green,blue));
this.setTitle("红:"+ red+" 绿:"+green +" 蓝:"+blue);
}
public static void main(String[] args)
{
new text();
}
}