Home J2me J2ME Hello World Example



J2ME Hello World Example
Posted on: May 25, 2009 at 12:00 AM
This is the simple hello world application.

J2ME Hello World Example

     

This is the simple hello world application. In this example we are creating a form name "Hello World" and creating a string message "Hello World!!!!!!!" as below: 

Form form = new Form("Hello World");   

String msg = "Hello World!!!!!!!";

In this application, To display the message we are using append method with the form as below:

 form.append(msg);

 

 

The Application is as follows:

 

HelloWorld.java

 

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;

public class HelloWorld extends MIDlet{
  private Form form;
  private Display display;

  public HelloWorld(){
  super();
  }

  public void startApp(){
  form = new Form("Hello World");
  String msg = "Hello World!!!!!!!";
  form.append(msg);
  display = Display.getDisplay(this);
  display.setCurrent(form);
  }

  public void pauseApp(){}
  
  public void destroyApp(boolean unconditional){
  notifyDestroyed();
  }
}

 

Download Source Code

Related Tags for J2ME Hello World Example:
cstringormformnamethismessageforexampleexamldeinrmasmtrsageesagemecreatingxaxampsssaessatishellollmpleaandarstrsassriringthbelostatihellopleplndo


More Tutorials from this section

Ask Questions?    Discuss: J2ME Hello World Example   View All Comments

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.