hi,
having problems creating menus in j2me.
Found alot of code around using MenuElements, lists and all sorts of things.
my code for the list is roughly like this:
{
List menu=new List("MainMenu",List.IMPLICIT);
int num1, num2, num3,num4,num5;
private Command cmd = new Command("Select", Command.OK, 1);
Displayable display1;
public void options()
{
num1 = 0;
num2 = 1;
num3 = 2;
num4 = 3;
num5 = 4;
menu.append("Start Game", null);
menu.append("High Scores", null);
menu.append("Instructions", null);
menu.append("About", null);
menu.append("Exit", null);
menu.addCommand(cmd);
menu.setCommandListener(this);
display1.setCommandListener(this);
}
The problem now is how to i check which one is pressed?
Or is there a better way to do this?
Is will be quick a simple menu as you can see.
Any advice is appreciated

Reply With Quote


