开发者

J2ME - changing views in game

I am currently writing a J2ME app for a card game which begins at a menu screen which gives the option to select a number of different card games to play.

This menu screen is a form and I need to know how to navigate to the new form for the games.

public void commandAction(Command c, Displayable s) {

        if(c.equals(exitComm)){ 
                  }
                else if(c.equals(gameComm))
                {
                 //start the queen game...create instance of QueensForm
                  QueensForm form = new QueensForm(null, "Queens");
                  display.setCurrent(form);
                  System.out.println("pressed play");
                }

As it stands the app com开发者_如何学运维piles and runs, however when the play button is clicked an error occurs and it says the problem is on the line display.setCurrent(form); I am unsure of the problem and was wondering if anybody could help me to sort this out or suggest a better way to navigate throughout the forms in the app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜