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

Playing with Numbers

The FormTextFieldTest class provides a simple calculator that can perform multiplication and addition. It offers examples of how to use Form, Item, TextField, and StringItem objects to process messages that indicate the type of operation to be performed and display the result of the calculation. It also provides examples of the use of casting and the Double class for retrieving values of the string type from TextField objects and then converting them into float values so that the calculations can be displayed. To process the messages from a TextField object, the ItemStateListener interface is implemented. The itemStateChanged() method, which is the sole method provided by the ItemStateListener interface, allows you to process ...

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