问题是为何按了test按钮没有用?谢谢!
代码很简单:import java.awt.*;
import java.applet.*;
import java.awt.event.*;public class t4 extends Applet implements ActionListener
 {public void init()
   {Button b=new Button("test"); add(b);    b.addActionListener(this);   }
  public void actionPerformed(ActionEvent e)
   {if(e.getActionCommand().equals("test")) add(new Button("new"));
   } 
 }HTML页面也很简单:<html>
<head>
<title>Find Friend</title>
</head>
<body>
<applet code="t4.class" width=400 height=400>
</applet> 
</body>
</html>