LẬP TRÌNH J2ME CHO THIẾT BỊ DI ĐỘNG PHẦN 5

import javax.microedition.lcdui.*;
public class MainMenuScreen extends List implements CommandListener {
private Eliminator midlet;
private Command selectCommand = new Command("Select", Command.ITEM,1);
private Command exitCommand = new Command("Exit", Command.EXIT,1);
private Alert alert;
public MainMenuScreen(Eliminator midlet) {
super("Eliminator",Choice.IMPLICIT);
this.midlet = midlet;
append("New Game",null);
append("Settings",null);
append("High Scores", null);
append("Help",null);
append("About",null);
addCommand(exitCommand);
addCommand(selectCommand);
setCommandListener(this);
}
public void commandAction(Command c, Displayable d) {
if (c == exitCommand) {
midlet.mainMenuScreenQuit();
return;
} else if (c == selectCommand) {
processMenu(); return;
} else {
processMenu(); return;
}
}