Java webstudio 2005

Source: Internet
Author: User
Java webstudio 20052005 supports j2-based development. With WTK2.2, 15 j2-based development project templates are provided. Follow these steps to develop a mobile game using the j2s template provided by Java webstudio 2005:
(1) start JavaWebstudio
(2) create a new mobile game project using the J2's Template
Use the "file"-"new project" menu to create a new project.
In the Create project dialog box, set the project type to "JME application project", the template name to "implementation menu template", and the project name to "JmeMenu ".
The directory structure of the new project is as follows:
(3) the main entry and implementation code of this project are included in the FirstMIDlet. java file. The content is as follows:
Package my;
Import javax. microedition. midlet .*;
Import javax. microedition. lcdui .*;
Public class FirstMIDlet extends MIDlet
{
Private Display display;
Public FirstMIDlet ()
{
Display = Display. getDisplay (this );
}
Public void startApp ()
{
Form f = new Form ("test ");
Command c1 = new Command ("Back_1", Command. BACK, 2 );
Command c2 = new Command ("Back_2", Command. BACK, 1 );
Command c3 = new Command ("Back_3", Command. BACK, 3 );
F. addCommand (c1 );
F. addCommand (c2 );
F. addCommand (c3 );

Display. setCurrent (f );
}
Public void pauseApp ()
{
}

Public void destroyApp (boolean unconditional)
{
}
}
(4) the project description file MyFirst. jad contains the following content:
MIDlet-Name: HelloWorld
MIDlet-Version: 1.0.0
MIDlet-Vendor: Sun Microsystems, Inc.
MIDlet-Description: Sample Hello World MIDlet
MIDlet-Info-URL: http://java.sun.com/j2me/
MIDlet-Jar-URL: the Jar file URL
MIDlet-Jar-Size: the JAR file Size
MicroEdition-Profile: MIDP-1.0
MicroEdition-Configuration: CLDC-1.0
MIDlet-1: MyFirstMIDlt, my. FirstMIDlet
In MyFirst. in the jad file, pay special attention to one item, namely, the MIDlet-Jar-Size item, which describes the Size of the JAR package file generated by the project, this item needs to be changed after the program is modified and then compiled. In javawebstudio, during compilation, antwill call the setjarsize.exe file in the javawebstudioindirectory to extract the size of the project JAR file and fill in this item automatically.

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.