J2ME的MDIP中ALERT的问题(100分)

S

smilboy

Unregistered / Unconfirmed
GUEST, unregistred user!
}
}
/**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(MIDlet1).setCurrent(alert1);
这句该怎么写?
}
}
 
看来用J2ME的很少哇!
 
接受答案了.
 
顶部