到 Google 资讯主页   
EasyJF首页   资料   源码   软件    论坛   网站    
   使用帮助    
    该信息为本站MyRSS系统缓存内容,部分图片及附件有可能无法正常使用.easyjf.comwww.matrix.org.cn无关,不对该信息负责.通过http://www.matrix.org.cn//resource/article/0/27.html访问该信息的原始内容.
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   
J2ME开发步骤
作者:chris 来源:www.matrix.org.cn  发布时间:2006-02-22 17:49:33.39

J2ME开发步骤
1.      系统要求
v       Pentium 100以上CPU
v       64MB 内存
v       Windows NT Workstation 4.0(Service Pack 3)或Windows 98
v       6 MB自由硬盘空间
v       Java 2 SDK, Standard Version, 版本1.2.2或者更高
2.      安装Java 2 SDK
在使用Motorola SDK之前必须安装JDK,Standard Edition。
请从http://java.sun.com/products/jdk 下载JDK,并按照Sun的指导安装到PC中。
3.      安装Motorola SDK
安装之前请先卸载以前版本的Motorola SDK:
1.      选择"开始à设置à控制板"
2.      选择"添加/删除程序"
3.      查找到"Motorola SDK Components for the J2ME Platform"
4.      点击"卸载"
5.      用资源管理器删除"<install-dir>\MotoSDK"目录
安装SDK:


1.      运行"Motorola_SDK.exe"
2.      按照提示安装程序
注意:安装程序需要口令,请向Motorola公司索取。
4.      编写第一个程序
在目录"<install-dir>\MotoSDK\demo\midlets\com\mot\j2me\midlets\
tutorials\"中,用编辑器创建文件"HelloWorld.java"。

/*
* HelloWorld.java
*
* June 27, 2000
*
* ? Copyright 2000 Motorola, Inc. All Rights Reserved.
* This notice does not imply publication.
*/
package com.mot.j2me.midlets.tutorials;
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
/**
* A simple Hello World midlet
*
* @see MIDlet
*/


public class HelloWorld extends MIDlet {
/**
* Main application screen
*/
private Form mainScreen;
/**
* A reference to the Display
*/
private Display myDisplay;
/**
* Creates a screen for our midlet
*/
HelloWorld() {
myDisplay = Display.getDisplay(this);
mainScreen = new Form("Hello World");
/*
* Create a string item
*/
StringItem strItem = new StringItem("Hello", "This is a J2ME MIDlet.");
mainScreen.append(strItem);
}
/**


* Start the MIDlet
*/
public void startApp() throws MIDletStateChangeException {
myDisplay.setCurrent(mainScreen);
}
/**
* Pause the MIDlet
*/
public void pauseApp() {
}
/**
* Called by the framework before the application is unloaded
*/
public void destroyApp(boolean unconditional) {
}
}


5.      编译
编译"HelloWord"
1.      在命令行窗口中,进入目录"<install-dir>\MotoSDK\demo\midlets"
2.      输入"compileAll com\mot\j2me\midlets\tutorials\HelloWorld.java"
6.      运行
运行"HelloWord"


2.      输入"runEmul com.mot.j2me.midlets.tutorials.HelloWorld"

from-tsinghua

 
相关文章
 
页面功能  【加入收藏】 【推荐给朋友】 【字体:  】 【关闭】   


EasyJF.com 2006 隐私政策 使用EasyJF前必读