/* This program is designed for you to check on how to compile, verify and run, and package applications. We will later describe the code*/ import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class Welcome extends MIDlet implements CommandListener{ // declarations private Display display; // reference to a Display object private TextBox tbMain; // refernce to a text box containing a text private Command cmExit; // exit the application command // constructor public Welcome(){ display = Display.getDisplay(this); // method to get display cmExit = new Command("Exit", Command.EXIT, 1); tbMain = new TextBox("Welcome", "MIDP Lab", 50, 0); tbMain.addCommand(cmExit); tbMain.setCommandListener(this); } // Start Application is called by application manager to start the MIDlet public void startApp(){ display.setCurrent(tbMain); } // Pause Application a required method public void pauseApp(){ } // Destroy Application a required method public void destroyApp(boolean unconditional){ } // Check and see if the Exit command has been selected public void commandAction(Command c, Displayable s){ if (c == cmExit){ destroyApp(false); notifyDestroyed(); } } }