开发者

J2ME Polish FramedForm Commands

I'm developing an application with J2ME Polish using a FramedForm.

I'm trying to append an item associated with a Command1 to the FramedForm and another item associated with a Command2 to the bottom of the FramedForm.

FramedForm menuForm = new FramedForm("Menu");

Command command1 = new Command("command1", Command.ITEM, 1);
Command command2 = new Command("command2", Command.ITEM, 2);

IconCustomItem item1 = new IconCustomItem("test1", null);
item1.addCommand(Com开发者_StackOverflow社区mand1);
menuForm.append(item1);

IconCustomItem item2 = new IconCustomItem("test2", null);
item2.addCommand(Command2);
menuForm.append(Graphics.BOTTOM, item2);

The problem is that the footer item is associated with both commands. I've tried using removeCommands() with no success. How can I associate the footer item only to the Command2?

Thanks.


Try setting a default command to each item, instead of adding a single command. Like:

item1.setDefaultCommand( command1 );

See for more info for commands on Items:


I solved the problem focusing the bottom frame.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜