package hello; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; import javax.microedition.rms.*; public class Midlet extends MIDlet implements CommandListener { private Display display; List Menu = new List("Choose One:", List.IMPLICIT); List Level_choose = new List("Choose One:", List.IMPLICIT); public void startApp() { display = Display.getDisplay(this); try { this.Menu.append("Start Game",null); this.Menu.append("Top Scores",null); this.Menu.append("About us",null); this.Menu.append("Exit Game",null); Menu.setCommandListener(this); display.setCurrent(Menu); Level_choose.setCommandListener(this); } catch (Exception e) { e.printStackTrace(); } } public Display getDisplay() { return display; } public void pauseApp() { } public void destroyApp(boolean unconditional) { notifyDestroyed(); } public void exit() { System.gc(); destroyApp(false); notifyDestroyed(); } public void commandAction(Command c, Displayable d) { List li = (List) display.getCurrent(); switch (li.getSelectedIndex()) { case 0: display.setCurrent(this.Level_choose); this.choosed = true; break; case 1: case 2: break; case 3: exit(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)