MDIP中ALERT的问题(使用JB7+MOBILESET3)

smilboy 2002-08-14 06:32:29

/**Component initialization*/
private void jbInit() throws Exception {
// set up this Displayable to listen to command events
alert1 = new Alert("");
alert1.setTitle("Error");
alert1.setString("Press any key to continue");
alert1.setType(AlertType.ERROR);
setCommandListener(this);
// add the Exit command
addCommand(new Command("Exit", Command.EXIT, 1));
addCommand(new Command("Alert", Command.SCREEN, 1));
}

/**Handle command events*/
public void commandAction(Command command, Displayable displayable) {
/** @todo Add command handling code */
if (command.getCommandType() == Command.EXIT) {
// stop the MIDlet
MIDlet1.quitApp();
}
if (command.getLabel()=="Alert"){
Display.getDisplay(this).setCurrent(alert1);
//这句该怎么写呢,我用MIDlet1.instance也不行?
}
}

}
...全文
127 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧