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

The NameGameTest Class

The NameGameTest class allows you to explore a few uses of TextBox, Alert, AlertType, and Command items. It allows you to enter the name of an author in a field and then retrieve information on the author. Three Command objects are associated with a single TextBox object, and when you process the events generated by the objects, you obtain one of two Alert objects. One of these furnishes information on the author whose last name you have typed. The other provides help. If you do not know the name of an author, the help option shows the list of choices. Here is the code for the NameGameTest class. You can find it in the Chapter 9 folder, and it is included in the NetBeans Chapter9MIDlets project.

/* * Chapter9 \ NameGameTest.java ...

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