import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.applet.*;
public class test5_7 extends Applet implements ActionListener
{
JTextField text;
JButton button1,button2,button3,exit_button;

public void init()
{
button1=new JButton("刘德华");
button2=new JButton("张学友");
button3=new JButton("黎明");
exit_button=new JButton("退 出");
text=new JTextField(10);
button1.addActionListener(this);
button2.addActionListener(this);
button3.addActionListener(this);
exit_button.addActionListener(this);
add(button1);
add(button2);
add(button3);
add(text);
add(exit_button);
setSize(300,200);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==button1)
text.setText("刘德华");
else if(e.getSource()==button2)
text.setText("张学友");
else if(e.getSource()==button3)
text.setText("黎明");
else if(e.getSource()==exit_button)
System.exit(0);
}

}
//<applet code=test5_7  width=500 height=400></applet>
求助高手帮忙看看哪里又错,为什么我调试的时候“按钮”无效呢