O'Reilly logo

Java™ ME Game Programming, Second Edition by Ph.D. Martin J. Wells, Ph.D. John P. Flynt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

TextField

One of the most commonly used of the Item subclasses is the TextField class. It provides a convenient way to format text as it is entered or displayed. To apply formatting to the text processed by TextField objects, you can use one of several TextField properties. Among these are the DECIMAL and ANY properties, which are reviewed in Table 10.2. Since a TextField object is a subclass of Item, you can store it in an array of the Item type. You can then handle the messages from the TextField object by using the itemChanged() method, which is provided by the ItemStateListener interface.

Table 10.2. TextField
MethodDescription
TextField (String, String, int, int)Constructs a new TextField. The first argument is of the string type and provides ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required