java 图形化程序Applet  ---- welcome to java

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Label;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class AppletInOut extends Applet implements ActionListener {
	Label prompt;
	TextField input,output;
	
	public void init() {
		prompt = new Label("input you name");
		input = new TextField(6);
		output = new TextField(20);
		add(prompt);
		add(input);
		add(output);
		input.addActionListener(this);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		output.setText(input.getText()+",welcome to java");
	}
}


程序运行效果图:

java   ----  welcome to java Applet_class