选择显示字体大小

j2me开发步骤

1. 系统要求

pentium 100以上cpu 

64mb 内存 

windows nt workstation 4.0(service pack 3)或windows 98

6 mb自由硬盘空间 

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. 运行

1.运行"helloword"

2. 输入"runemul com.mot.j2me.midlets.tutorials.helloworld"


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons