Sponsered Links
Categories
Sponsered Links

Download and Install J2ME

 

For Windows and Linux Download Sun Java Wireless Toolkit 2.5.2_01 for CLDC, From Here: http://java.sun.com/products/sjwtoolkit/download.html

  1. Run the exe File: sun_java_wireless_toolkit-2.5.2_01-win.exe

  2. Go to Start > Programs > Sun Java Wireless Toolkit 2.5.2 for CLDC > Wireless Toolkit 2.5.2. Then the console window appears like this:

  3. Now, Click the “New Project” on the sun java wireless toolkit menu bar, then a new project box opens. Fill the Project name (Worldinfosoft) and MIDlet class Name (HelloWorld). After that, click on button "Create Project".

  4. Then Settings for project "Worldinfosoft” window appears automatically. Choose Target Platform "JTWI", Then click OK. Like this:

  5. Then appears a window showing the updated project settings saved on the Console.
  6. Now create a "HelloWorld.java" file in the src folder of your created project, the directory structure is as follows: 

                                         

    In the above first directory structure you can see "src" folder in your project "Worldinfosoft" where you will be created your "HelloWorld.java" file and In the second directory structure figure you can see "apps" folder, in which your project will meet. Put the given below code in the "HelloWorld" file and save it from '.java' extension.

  7. Now run your Tool Kit from "Start-->Programs-->sun_java_wireless_toolkit-2_5_2_01-win-->Wireless Toolkit 2.5.2" which is like given figure on top of this page.

  8. Now, Click the “Open Project” on the toolkit menu bar

  9. Then click the “Build” button on the toolkit menu bar. This compile the Java source files.

  10. Then After click the “Run” button. This executes the compiled Java class files on the emulator.

  11. Then Output of project "Worldinfosoft" at emulator is like this:

 

 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("HelloWorld");
    String msg = "Hello World";
    form.append(msg);
    display = Display.getDisplay(this);
    display.setCurrent(form);
  }

  public void pauseApp(){}

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

 
 
Sponsered Links
Latest Updates
 
All Content of this site is for learning only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user. While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright © 2009 JSPSERVLETTUTORIAL.INFO All Right Reserved