TextField
A TextField is a simple scrollable text display object with one row of
characters. The width of field is specified during construction and an
initial string may be specified.
Corresponding source code:
import java.applet.*;
import java.awt.*;
public class TextFieldWidget extends Applet {
public void init()
{
TextField f1 = new TextField("type something");
add(f1);
}
}
Method(s) of note:
- public TextField(String text)
Create a TextField with the specified initial contents.
- public TextField(String text, int cols)
Create a TextField with the specified initial contents and initial number of columns.
Related Magercise(s):