LWUIT命令按钮并非始终可见 [英] LWUIT Command buttons not always visible

查看:78
本文介绍了LWUIT命令按钮并非始终可见的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经编写了一个LWUIT应用程序,但是每隔几次在内置的Netbeans J2ME模拟器或Nokia Series 40模拟器中运行它时,主页上的命令按钮将不会显示.如果我按下软键以使第二个命令进入帮助屏幕,然后返回,则该命令可见.我完全按照教程设置了命令,并使用了以下几行代码:

I've written a LWUIT app but every few times I run it in the builtin Netbeans J2ME emulator or the Nokia Series 40 emulator, the command buttons for the main page do not show up. If I hit the softkey for the second command to go the the help screen, then go back, the commands are visible. I setup my commands exactly according to the tutorial, with these few lines of code:

        Command exitCommand = new Command("Exit");
        f.addCommand(exitCommand);
        Command settingsCommand = new Command("Help/About");
        f.addCommand(settingsCommand);
        f.addCommandListener(this);

我应该注意LWUIT 1.5中是否存在某种错误?由于它在大多数情况下都有效,并且代码非常简单,所以我不知道是什么编码问题导致的.有趣的是,到目前为止,除了在首次运行应用程序时加载的主页之外,任何页面都没有发生.

Is there some sort of bug in LWUIT 1.5 that I should be aware of? Since it works most of the time and it's such a simple bit of code, I don't know what coding problem might cause it. It is interesting however that, as of yet, it hasn't happened on any page except for the main page which loads when the application is first run.

推荐答案

如果要在 f.show() 之后添加命令按钮,则可能会出现此问题向上.如果是这样,请在添加命令按钮后尝试提供 f.show() .

If you are adding the command button after f.show() , then this issue might come up. If it is so try giving f.show() after adding command button.

这篇关于LWUIT命令按钮并非始终可见的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆