LWUIT Command buttons not always visible

百般思念 提交于 2019-12-24 10:59:22

问题


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);

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.


回答1:


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.




回答2:


We are not aware of such an issue. LWUIT 1.5 introduced allot of changes to the behavior of the commands e.g. command behavior & extensible MenuBar class. So it is quite possible that an issue has crept up related to this.

I suggest you follow this up in the LWUIT issue tracker if the problem can be reproduced.



来源:https://stackoverflow.com/questions/7452243/lwuit-command-buttons-not-always-visible

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!