Click here to Skip to main content
15,881,882 members
Articles / Programming Languages / Java / Java SE / J2ME

J2ME: Hello World Mobile Application

Rate me:
Please Sign up or sign in to vote.
4.56/5 (8 votes)
17 Mar 2011CC (ASA 3U)3 min read 101.8K   4.7K   16  
This is a J2ME beginner article that describes how to write your Hello World J2ME application
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

/**
 *
 * @author Fadi Z. Hania
 * <a title="Fadi Hania Blog"  href="http://fadihania.com/" target="_blank">Fadi Hania Blog</a>
 * Follow Me On Twitter: @fadihania
 *
 */

public class HelloMIDlet extends MIDlet {
    private Display display;
    private Form helloFrm;

    public HelloMIDlet() {
        helloFrm = new Form("Hello World");
    }

    protected void startApp() {
        display = Display.getDisplay(this);
        display.setCurrent(helloFrm);
    }

    protected void pauseApp() {
    }

    protected void destroyApp(boolean unconditional) {
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-Share Alike 3.0 Unported License


Written By
Software Developer (Senior) Wateen Technologies
Palestinian Territory (Occupied) Palestinian Territory (Occupied)
A professional developer with a B.Sc. in Computer Engineering. Developing Web, Moblie and Desktop applications and interested in reading and blogging. A cofounder of Wateen Technologies an application development and hosting company.
Visit Fadi Hania Blog to read articles written by Fadi Hania, follow Fadi Hania at Twitter and become a friend with Fadi Hania on Facebook

Comments and Discussions