Unlike a TextField, a TextBox is a multiline, editable text
area. TextBox is a kind of Screen, not an Item. Because a TextBox is a Displayable, you must create a MIDlet
object to demonstrate its use; you can't place it in another Screen or Form, as you can with
the components derived from Item.

The program below shows the partial source code of the TextBoxDemo class. The parts that are
omitted are very similar structurally to the UIComponentDemo code, and relate to the
attributes of the MIDlet.

You can see from the constructor that a TextBox is similar to a TextField, except that it's a
multiline text area. The arguments are the title, the initial
text, the maximum number of characters
that it can hold, and the input constraints. The constraints are
exactly the same constraints used by
the TextField class.

Just as with other editable objects, you simply select the TextBox using the
emulator's Select button and then edit the contents. You can navigate using the four arrow keys, erase
characters using the Clear key, and input using either the keypad keys or your computer keypad
when you're using an emulator. Of course, the program can also manipulate the content using a
rich API that supports inserting, deleting, setting the maximum size, setting constraints, and so
forth.