[求助]这段代码怎么调
package com.wy.ch6;import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class tcmd extends MIDlet implements CommandListener{ //提示tcmd错误但是能编译,却不能执行键盘工能
private Display dis;
private Form f;
private Command cmd1,cmd2,cmd3;
public tcmd() {
// TODO Auto-generated constructor stub
dis=Display.getDisplay(this);
f=new Form("测试");
cmd1=new Command("退出",Command.EXIT,1);
cmd2=new Command("帮助",Command.HELP,2);
cmd3=new Command("返回",Command.BACK ,2);
f.addCommand(cmd1);
f.addCommand(cmd2);
f.addCommand(cmd3);
f.setCommandListener(this);
}
public void destroyApp(boolean arg0) throws MIDletStateChangeException {
// TODO Auto-generated method stub
}
public void pauseApp() {
// TODO Auto-generated method stub
}
public void startApp() throws MIDletStateChangeException {
// TODO Auto-generated method stub
dis.setCurrent(f);
}
public void commandAction(Command command,Display displayable){//这段代码不能执行
if (command.getLabel().equals("帮助")){
System.out.println("帮助");
}
if (command.getLabel().equals("退出")){
System.out.println("退出");
}
if (command==cmd3){
System.out.println("返回");
}
}
}
[[it] 本帖最后由 sun_life 于 2008-6-3 21:17 编辑 [/it]]