1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Big2 extends MIDlet implements CommandListener
{
private Command _commandExit;
private Command _commandScores;
private Command _commandOK;
private String[] elements = { "Joueur 1", "Joueur 2", "Joueur 3", "Joueur 4"};
private List menu = new List("Big2", List.IMPLICIT,
elements, null);
public Big2()
{
_commandExit = new Command("Exit", Command.EXIT,1);
_commandScores = new Command("Scores", Command.EXIT,2);
_commandOK = new Command("OK", Command.SCREEN,1);
menu.addCommand(_commandScores);
menu.addCommand(_commandExit);
menu.setCommandListener(this);
menu.addCommand(_commandOK);
menu.setCommandListener(this);
}
public void startApp()
{
show();
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c, Displayable d) {
if (c == _commandExit) {
destroyApp(true);
notifyDestroyed();
return;
}
/*switch (menu.getSelectedIndex()) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
break;
}*/
}
void show() {
Display.getDisplay(this).setCurrent(menu);
}
Displayable getDisplayable() {
return menu;
}
} |
Partager