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

public class button extends Applet implements ActionListener{
	Button btn;
	Label lbl;
	TextField txt;
	String str;
	public void init() {
		btn = new Button("Press Me!");
		add(btn);
		btn.addActionListener(this);
		lbl = new Label("");
		add(lbl);
		txt = new TextField(15);
		add(txt);
	}
	
	public void actionPerformed(ActionEvent a) {
		str = a.getActionCommand();
		repaint();
	}
	
	public void paint(Graphics g) {
		String str1 = txt.getText();
		lbl.setText(str1);
		g.drawString(str, 0, 100);
	}
}
