//这样试试
public class app extends Applet implements ActionListener
{
TextField t;
Button bt1;
public void init()
{

    t=new TextField(10);
    add(t);
    bt1=new Button("set");
    add(bt1);
    bt1.addActionListener(this);
}public void actionPerformed(ActionEvent event)
{
if(event.getSource() == bt1)   
{
    t.setText("My God!");
 }
}public void paint(Graphics G)
{
G.drawString("God!It's Java!",60,100);
}
}