Java ME Hello World

[color=green]附件为J2ME所有源码[/color]

[img]http://dl.iteye.com/upload/picture/pic/122328/420c4cab-e498-35e5-94fa-d33fb0da3a79.jpg[/img]

[img]http://dl.iteye.com/upload/picture/pic/122310/89aea4de-a101-364b-a48a-4b699968e690.jpg[/img]

[img]http://dl.iteye.com/upload/picture/pic/122312/782ed010-87e7-3e63-8205-353cd716e81a.jpg[/img]

[img]http://dl.iteye.com/upload/picture/pic/122314/56004460-9802-32d5-ab59-1054f45777af.jpg[/img]

[img]http://dl.iteye.com/upload/picture/pic/122316/fa6f01d8-2ba6-38ce-a7b5-642a09dbedcd.jpg[/img]

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.TextBox;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class FirstProMIDlet extends MIDlet implements CommandListener {

private Command exitCommand;

private TextBox tbox;

public FirstProMIDlet(){

exitCommand=new Command("Exit",Command.EXIT,1);
tbox=new TextBox("Hello world Midlet","Hello World !",25,0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}

protected void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
Display.getDisplay(this).setCurrent(tbox);
}

public void commandAction(Command cmd, Displayable disp) {
// TODO Auto-generated method stub
if(cmd==exitCommand){
try {
destroyApp(false);
} catch (MIDletStateChangeException e) {
e.printStackTrace();
}
notifyDestroyed();
}
}

protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub

}

protected void pauseApp() {
// TODO Auto-generated method stub

}
}


[img]http://dl.iteye.com/upload/picture/pic/122318/7d3930ab-5602-3245-a651-5f35cf91d1a7.jpg[/img]

[img]http://dl.iteye.com/upload/picture/pic/122324/1bb57e63-50ff-36b2-b1d0-ade1f4a52955.jpg[/img] [img]http://dl.iteye.com/upload/picture/pic/122326/5119d78b-4359-323c-9573-53268b5e81a9.jpg[/img]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值