import java.awt.*;
import java.awt.event.*;
import java.applet.*;
// TextFieldExample
// This applet creates some text fields and a text area
// to demonstrate the features of each.
//
public class TextFieldApplet extends Applet{
protected TextField passwordField;
protected TextArea textArea;
public void init() {
passwordField = new TextField(10); // 10 columns
passwordField.setEchoChar('*'); // print '*' for input
add(passwordField);
textArea = new TextArea(5, 40); // 5 rows, 40 cols
textArea.append("This is some text for the text area.");
textArea.select(5, 12); // select "is some"
add(textArea);
passwordField.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event){
textArea.setText("Your password is: "+
event.getActionCommand());
}
});
}
}