TextArea

A TextArea is a multi-row text field that displays a single string of characters, where newline ends each row. The width and height of the field is set at construction, but the text can be scrolled up/down and left/right.



Corresponding source code:

import java.applet.*;
import java.awt.*;
public class TextAreaWidget extends Applet {
    public void init() {
        TextArea disp = new TextArea("A TextArea", 3, 30);
        add(disp);
    }
}

Method(s) of note:

There is no predefined way to set a particular row of text. Carriage returns are used to separate the rows, which must be counted to get to the nth row.

Related Magercise(s):