Hello World J2me Application



Softwares Needed :

  1. Eclipse

  2. J2ME Plugin for Eclipse

  3. Download and Install WireLess toolkit from http://java.sun.com/products/sjwtoolkit/

  4. HelloWorld Program


Installing J2me Plugin for Eclipse


  1. From Help - >Software Updates -> Find And Instal.












  1. Go to Next tab and click New Remote site .


Enter name as ej2me and URL http://www.eclipseme.org/updates/ and click ok and finish.









After it installs restart eclipse.


  1. Go to windows - > Preferences - > J2ME

    if its there its installed successfully.

Click Device Management - > Import




Browse and select your Wireless toolkit directory




Click Finish.


  1. Writing the HelloWorld Program.






Click -Next -> Next and Finish....


Now the Code.

Right Click the project and then Select – Other and New J2ME Midlet under J2ME







click finish HelloMidlet structure code is generated .



Modify the constructor and add a text box


private TextBox helloBox;

public HelloMidlet() {

// TODO Auto-generated constructor stub

helloBox = new TextBox("Hello world MIDlet", "Hello World!", 25, 0);

}


In the startApp method add this

Display.getDisplay(this).setCurrent(helloBox);


Run the program now. Right click and select Run as J2ME emulet