// HelloSimpleMIDlet.java (c) Kari Laitinen // http://www.naturalprogramming.com // 2007-08-30 File created. // 2007-08-30 Last modification // This is a simple midlet, a Java program that can run on a mobile phone. // This program shows the text "Hello. I am a simple Java midlet." // on the small screen of a mobile phone. // The text to be shown is stored inside a StringItem object, which in // turn is attached onto a Form object. The Form object is set as the // current content of the Display object that represents the physical // display of the phone. import javax.microedition.lcdui.*; import javax.microedition.midlet.*; public class HelloSimpleMIDlet extends MIDlet { Display display_of_this_midlet = Display.getDisplay( this ) ; Form form_for_string_item = new Form( "THIS IS THE TITLE OF A Form" ) ; public HelloSimpleMIDlet() { StringItem text_to_be_shown = new StringItem( "", "Hello. I am a simple Java midlet.") ; form_for_string_item.append( text_to_be_shown ) ; } protected void startApp() throws MIDletStateChangeException { display_of_this_midlet.setCurrent( form_for_string_item ) ; } protected void pauseApp() { } protected void destroyApp( boolean unconditional_destruction_required ) { } }