J2ME - 改变游戏中的视图
我目前正在为纸牌游戏编写一个 J2ME 应用程序,该应用程序从一个菜单屏幕开始,该屏幕提供了选择要玩的许多不同纸牌游戏的选项。
这个菜单屏幕是一个表单,我需要知道如何导航到游戏的新表单。
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");
}
按照目前的情况,应用程序编译并运行,但是当单击播放按钮时,会发生错误,并显示问题出在 display.setCurrent(form);
行上,我不确定问题所在,并且是想知道是否有人可以帮助我解决这个问题或建议更好的方法来浏览应用程序中的表单。
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 compiles 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论