开发者

LWUIT Command buttons not always visible

开发者 https://www.devze.com 2023-04-06 00:31 出处:网络
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

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 Comman开发者_StackOverflowd("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.


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.


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.

0

精彩评论

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

关注公众号