/* This example is the follow on of the previous example. This idea here is to practice compile, pre-verify and run the midlet successfully. The additional task here is to use this midlet and the previous one to create a package*/ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class WelcomeBack extends MIDlet implements CommandListener { // Some declarations private Display display; // references to a Display object private List lsMain; // reference to a List object private Command cmExit; // exit command // constructor public WelcomeBack(){ display = Display.getDisplay(this); lsMain = new List("Welcome Back", Choice.IMPLICIT); // one item can be selected lsMain.append("MIDP Lab", null); cmExit = new Command("Exit",Command.EXIT,1); lsMain.addCommand(cmExit); lsMain.setCommandListener(this); } // Application manger calls the start App public void startApp(){ display.setCurrent(lsMain); } // pause app public void pauseApp(){ } // destroy app public void destroyApp(boolean unconditional){ } // check and see Exit command was chosen public void commandAction(Command c, Displayable s){ if (c == cmExit){ destroyApp(false); notifyDestroyed(); } } }