Professional Documents
Culture Documents
*; public class Thank extends MIDlet implements CommandListener { private Display display; Command cmdExit = new Command(" ,"Command.EXIT, 0); Command cmdBack = new Command(" ,"Command.BACK, 0); List mainList; Form form; Form form2; Ticker ticker; public Thank () { display =Display.getDisplay(this); mainList = new List("," List.IMPLICIT); ticker = new Ticker (" ;)" } public void startApp() { mainList.append(","null); mainList.append(","null); mainList.addCommand(cmdExit); mainList.setTicker(ticker); mainList.setCommandListener(this); display.setCurrent(mainList); } public void pauseApp(){ } public void destroyApp(boolean unconditional){} /************* implements CommandListener ****************/ public void commandAction(Command c, Displayable s) { if ( s == form ) if(c==cmdBack) { mainList.setCommandListener(this); display.setCurrent(mainList); if ( } s == form2 ) if(c==cmdBack) { mainList.setCommandListener(this); display.setCurrent(mainList);
if ( {
} s == mainList )
if (c == cmdExit)
{ }
destroyApp(false); notifyDestroyed();
else if ( c == List.SELECT_COMMAND ) if ( mainList.getSelectedIndex() == 0 ) { form = new Form(";)" form.append("\ n"); form.addCommand(cmdBack); form.setCommandListener(this); display.setCurrent(form); } else if (mainList.getSelectedIndex() == 1) { form2 = new Form(";)" form2.append("\ n"); form2.addCommand(cmdBack); form2.setCommandListener(this); display.setCurrent(form2); } }