import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class second extends Applet implements ActionListener
{
protected Label lblName;
protected TextField txtName;
protected TextField txtDisp;
public void Init()
{
?? lblName = new Label("请输入您的名字:");
txtName = new TextField(8);
txtDisp = new TextField(10);
add(lblName);
add(txtName);
add(txtDisp);
txtName.addActionListener(this); ?
?}
public void actionPerformed(ActionEvent e)
{
txtDisp.setText(txtName.getText() + "welcom to china");
}
public static void main(String args[])
{
Frame f = new Frame("欢迎");
f.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent evt)
{
System.exit(0);
}
}); //f.addWindowListener
second obj = new second();
obj.Init();
f.add("Center", obj);
f.setSize(400, 300);
f.show();
obj.start();
}//main
}