import java.applet.Applet;
import java.awt.Button;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class MainClass{
public void init() {
Button button1 = new Button("Clear");
final TextField textField1 = new TextField();
button1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent evt) {
textField1.setText("");
}
});
}
}
|