Hello World

Description:

The following code shows a simple HelloWorld MIDlet.

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class HelloWorld extends MIDlet {
  Display display;
  Form form;
  public void destroyApp(boolean unconditional) {
    notifyDestroyed();
  }
  public void pauseApp() {
  }
  public void startApp() {
    display = Display.getDisplay(this);
    form = new Form("Helloworld example");
    StringItem body = new StringItem(null,"Hello World!");
    form.append(body);
    display.setCurrent(form);
  }
}

Download:

HelloWorld.java

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)ies.aau.dk
Copyright © 2006 Department of Electronic Systems

Last update:11-10-2006