The Wayback Machine - https://web.archive.org/all/20051111111531/http://www.netbeans.org:80/kb/articles/import-mobility-40.html

Importing Existing J2ME MIDP Source Code into NetBeans IDE 4.0

This document explains how you can import existing Java™ 2 Platform, Micro Edition (J2ME™ platform ) source code into a NetBeans IDE 4.0 project. For more information about NetBeans IDE 4.0 projects and developing J2ME applications, see:


Requirements

You must have NetBeans IDE 4.0 and the NetBeans Mobility Pack 4.0 installed before you can start J2ME MIDP development. See the J2ME MIDP Development Download page for instructions on downloading and installing the complete environment.


Project Templates

There are three project templates you can use to import a J2ME MIDP project:


Importing J2ME Wireless Toolkit Projects


Using the Import J2ME Wireless Toolkit Template

  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Categories, select Mobile. Under Projects, select Import Wireless Toolkit Project and click Next.
  3. In the Specify WTK Toolkit project page, Choose the project you want to import. Click Next.
  4. In the Project Name and Location page, choose a home and a location for the new project. If you want the project to be your main project, leave the Set as Main Project check box checked. Click Next.
  5. Use the Platform Selection page to set the emulator platform that the IDE will use to compile and run the project. Click Finish.
  6. To test the Project, right-click the project node in the projects tab, and choose Run Project.


Importing a Project Created in Earlier Versions of Mobility


Using the Import Mobility Studio Project Template

  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Categories, select Mobile. Under Projects, select Import Mobility Studio Project and click Next.
  3. Use the Specify Suite page to locate the MIDlet suite you want to import. Mobility project definition files have the extension .adcontent. Click Next.
  4. Use the Project Name and Location page to define a new name and location for your NetBeans project. Click Next.
  5. Use the Platform Selection page to select the platform emulator that will be used to emulate device performance when the project is executed. Click Finish.

Importing a MIDP Project from Existing MIDP Sources


Using the Mobile Project from Existing MIDP Sources Template

  1. Choose File > New Project (Ctrl-Shift-N).
  2. Under Categories, select Mobile. Under Projects, select Mobile Project from Existing MIDP Sources and click Next.
  3. Use the Specify Sources page to locate the source directory for the source code and jad file you want to import. Click Next.
  4. Use the Project Name and Location page to define a new name and location for your NetBeans project. Click Next.
  5. Use the Platform Selection page to select the platform emulator that will be used to emulate device performance when the project is executed. Click Finish.

Importing a MIDP Project from Sources Within a CVS Repository

This approach preserves the file history of your source code. For this approach, the source files for the original project stored in cvs must be in a folder named <original project folder>/src.

If the project is not in the src directory, import the sources into a new project and check the entire project into cvs. This approach is simpler, but the file histories are not preserved.

Using the Mobile Project from Existing MIDP Sources Template

  1. Choose File > New Project.
  2. Under Categories, select Mobile. Under Projects, select Mobile Project from Existing MIDP Sources and click Next.
  3. Use the Specify Sources page to locate the source directory for the source code and .jad file you want to import. Click Next.
  4. Use the Project Name and Location page to define a new name and location for your NetBeans project. This is a temporary directory you will check back into cvs. Click Next.
  5. Use the Platform Selection page to select the platform emulator that will be used to emulate device performance when the project is executed. Click Finish.
  6. Copy the folder nbproject and the file build.xml back into the original project folder in cvs.
  7. Use the cvs commands to add and commit all new project files and folders to cvs, except nbproject/private.
  8. Right-click the temporary project and choose Close Project. You can delete this project outside the IDE.
  9. Choose File > Open Project and open the project from the original project folder in cvs.
 
 

Related Documents

Quickly create, build, and execute a simple J2ME MIDP application.
Quickly create, build, and execute a simple J2SE application.
A short guide to getting your existing Java applications into NetBeans IDE 4.0 .
A complete list of docs for the NetBeans 4.0 release.