Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Java ME (J2ME) Developer Guide
Previous Page Home Next Page

Creating a simple MIDlet

In this section, you will create a new MIDlet class, which is a Java class that derives from the javax.microedition.midlet.MIDlet superclass.

Java ME perspective

  1. In the Package Explorer view, right click the src folder and select the Open the Java ME MIDlet wizard New > Java ME MIDlet wizard.

    Select the Java ME MIDlet wizard

  2. On the New Java ME MIDlet wizard, select the appropriate information for the MIDlet to be generated. With the exception of the Add to Application Descriptor checkbox, all other information are the similar to the standard class creation parameters from JDT.

    Java ME MIDlet wizard

    Note that only classes derived from the javax.microedition.midlet.MIDlet class can be used in the Superclass field.

  3. Select the checkbox for Add to Application Descriptor.

    When this parameter is selected, the newly created MIDlet will automatically be added to the project's Application Descriptor with default information. The MIDlet information may be further refined by accessing the Application Descriptor Editor.

    Note that if you do not select the Add to Application Descriptor option, you must use the Application Descriptor Editor to enter the details for the particular MIDlet so it is properly registered as part of the project's MIDlet suite. If you do not do this, Java ME devices will not be able to access the MIDlet.

  4. Click Finish to create the new MIDlet class.
  5. The new MIDlet class is opened in the editor.

    The new Java ME MIDlet Class is created in the workspace

  6. If the Add to Application Descriptor checkbox was left unchecked the new MIDlet class must be added in the Application Descriptor.

    Java ME MIDlet wizard

  7. You can now start working in the new MIDlet.

Other perspectives

  1. In the Package Explorer view, right click the src folder and select the Open the Java ME MIDlet wizard New > Other... option.

    Select the Other... option

  2. Select the Java ME MIDlet wizard from the Java ME category.

    Select the Java ME MIDlet wizard

  3. Follow steps 2 through 7 from the Java ME perspective section.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire