【www.gdgbn.com--js教程】

T628降价了,买了一个玩玩,这个“鸡鸡”支持JAVA扩展,所以第一时间去http://developer.sonyericsson.com/site/global/home/p_home.jsp下载了最新的SDK(FILE SIZE:42M),下载的时候要注意,SDK说明中应该指出支持T628,eclipse和eclipseme是早就下好的,下面就该安装了:
1、安装j2se 1.4.2,并配置path和classpath
2、安装semc_j2me_sdk_2_1_5.exe,装完后我没有做任何配置(包括环境变量配置)
3、解压缩eclipse,然后把eclipseme解压缩到eclipse的plugins目录中
4、然后就配置eclipseme(如图1)
5、创建一个jeme工程,File/New/Project.../J2ME/J2ME Midlet Suite
6、在工程中添加Midlet,File/New/Other../J2ME/J2ME Midlet
7、编写代码
8、在Navigator的工程上点右键,执行右键菜单里的J2ME/Create Package
9、用模拟器(图2)或通过蓝牙传到手机上执行
(图1)
(图2)
代码如下:
----------------------------------------------------------
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
/*
* Created on 2005-1-10
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author libo
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Helloworld extends MIDlet implements CommandListener{
private Display display;
private Form mainForm;
private StringItem stringItem;
private Command exitCommand=new Command("Exit",Command.EXIT ,1);
/**
*
*/
public Helloworld() {
super();
// TODO Auto-generated constructor stub

本文来源:http://www.gdgbn.com/wangyezhizuo/5681/