Use EclipseME0.5.5 to create a simple J2EE Program

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.