Use EclipseME0.5.5 to create a simple J2EE Program
In the previous article "how to install EclipseME 0.5.5 on Eclipse3.0.1", we have discussed how to install the Eclipse program on Eclipse3.0.1.
Today we will use it to create our first program. The first program in most program tutorials is called HelloWorld. Let's compile a HelloWorld program.
1. File
2. Create a project
3. Select the j2-midlet Suite
4. Enter the project name myfirstj23.
5, select the j2mwireless Toolkit 2.1 MIDP 1.0 platform (here you can also choose MIDP 2.0 can be, but the current direct MIDP 2.0 phone is still a few, can query: http://jal.sun.com/webapps/device/device)
You can set the Java build by default. Then, click Finish to complete the basic settings of the j2_project.
After completing the preceding steps, you can see the following interface:
Files
More
Select j2_mm-midlet
?
Click Next to create a new j2-midlet program. Enter HelloWorld in the name. Then, click Finish to automatically generate some code. As shown below.
If we add one or two sentences to the program generated by Eclipse, we can create the simplest program HelloWorld.
Import javax. microedition. midlet. MIDlet;
Import javax. microedition. midlet. MIDletStateChangeException;
/*
* Created on 2004-10-21
*
* TODO To change the template for this generated file go
* Window-Preferences-Java-Code Style-Code Templates
*/
/**
* @ Author Administrator
*
* TODO To change the template for this generated type comment go
* Window-Preferences-Java-Code Style-Code Templates
*/
Public class HelloWorld extends MIDlet {
Private TextBox textbox; // Add
/**
*
*/
Public HelloWorld (){
Super ();
Textbox = new TextBox ("HelloWorld", "Hello, welcome to the world of j2s! ", 20, 0); // Add
// TODO Auto-generated constructor stub
}
/* (Non-Javadoc)
* @ See javax. microedition. midlet. MIDlet # startApp ()
*/
Protected void startApp () throws MIDletStateChangeException {
// TODO Auto-generated method stub
Display. getDisplay (this). setCurrent (textbox); // Add