我的程序代码编译通不过
我是java新手,好多都不懂,下面是我自己编的简单程序代码我找不出错误,但是编译通不过,提示监听那有错误,请帮忙更正一下。import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Demo extends JFrame {
public Demo(String t) {
super(t);
Container contentPane=this.getContentPane();
contentPane.setLayout(new FlowLayout());
setBackground(Color.white);
}
JButton a1=new JButton("demo1");
JButton a2=new JButton("demo2");
JButton a3=new JButton("demo3");
JLabel a4=new JLabel("demo4");
a1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){a4.setText("xu");}
});
a2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){a4.setText("xian");}
});
a3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){a4.setText("yue");}
});
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Demo beat =new Demo("good");
}
}