Example: Creating a simple test MIDlet

To present various LCDUI elements in an actual setting, this example MIDlet allows developers to see an implementation of a high-level API class (the Gauge class in this case) and of a low-level implementation of the Canvas class. The MIDlet is controlled with several Commands and the Canvas reacts to the value of the Gauge.

SimpleTest

This simple MIDlet creates a gauge you can manipulate and an option to open a colored screen with a line of text.

Figure 29: SimpleTest Gauge: Opening screen

This is the opening view of the MIDlet. You can quit the application at any time by pressing the Exit softkey.

Figure 30: SimpleTest Gauge: Manipulating the Gauge with Arrow keys

You can manipulate the gauge with the Arrow left and right keys.

Figure 31: SimpleTest Gauge: Manipulating the Gauge by writing the number with Numeric keys

You can also manipulate the gauge by pressing the Arrow down key, typing in a number and selecting the "Show levels" function from the Options menu.

Figure 32: SimpleTest HelloCanvas: Message visible

To open the colored screen, select the "Display message" function from the Options menu.

Figure 33: SimpleTest HelloCanvas: Message invisible

You can make the message disappear and appear again by pressing the Message softkey.