Java Reference
In-Depth Information
Accepting Copious Amounts of Text
The
TextBox
class provides a full-screen alternative to the
TextField
and shares an inter-
face similar to the
TextField
(only, unfortunately, the MIDP does not break up the text
interface into separate interfaces and implementations, as it did for
Choice
,
ChoiceGroup
,
and
List
). Figure 5-10 shows a
TextBox
.
Figure 5-10.
A TextBox
As you can see from the figure,
TextBox
instances are best for managing the input of
large chunks of text, and there's the rub: most MIDP-capable devices don't provide inter-
faces well suited to text entry. Consequently, I recommend that you avoid using
TextBox
instances if you can. Instead, try to design your application so that it requires as little text
input as possible, either by omitting long text entry entirely or by memorizing repetitive
text entry and presenting the memorized text as choices in a
List
or
ChoiceGroup
.