我正在开发 J2ME 应用程序。我想在表单中显示警报并显示另一个类的另一个表单。我尝试了以下方法来显示警报。
public void showMsg()
{
Alert success = new Alert("Data Not found.");
//success.setImage(img2);
success.addCommand(new Command("Ok", Command.OK, 0));
success.addCommand(new Command("Cancel", Command.CANCEL, 0));
success.setCommandListener(this);
success.setTimeout(Alert.FOREVER);
Display.getDisplay(parent).setCurrent(success, chapterForm);
}
显示警报后,我将跳转到另一种形式:
Display.getDisplay(parent).setCurrent(welcomeForm);
当我运行它时,它不会显示警报,而是跳转到 welComeForm。那么,我怎样才能显示警报然后跳转到另一个表单。