Creating ContactBookDemo MIDlet

This example tutorial demonstrates how to create a ContactBookDemo MIDlet that displays names from the Phonebook using the JSR-75 PIM API. The tutorial focuses on how the LWUIT UI components and features are used to build the UI of the MIDlet.

UI Components

The MIDlet makes use of the following LWUIT UI components and features:

  • Form

  • Layout

  • TextArea (using Nokia TextEditor)

  • List

Command Mapping

The MIDlet defines a minimal set of softkeys to ensure that it is easy to use. The Options menu is mapped to the left softkey (or to the menu button in the Header bar in the full touch UI) and the Exit and Clear Commands are mapped to the right softkey (or to the Back button in the full touch UI).

Source Code

import javax.microedition.midlet.MIDlet;

import com.sun.lwuit.Command;
import com.sun.lwuit.Display;
import com.sun.lwuit.Form;

public class Midlet extends MIDlet {
	public void startApp() {
		Form form = new Form("Hello World");
	public void pauseApp() {
	public void destroyApp(boolean unconditional) {

Display.init is a static method that creates a device-specific implementation class instance behind the scenes, and sets some parameters based on, for example, the number of softkeys and whether or not the device has a touch screen. Forms in LWUIT are analogous to LCDUI forms and represent different screens in the MIDlet.

To learn more about the ContactBookDemo see:

Last updated 15 January 2014

Back to top

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.