是否可以为 j2me 元素动态设置命令?
我有一个像按钮一样工作的 StringItem。标准菜单项(左侧的“后退”和右侧的“下一步”始终存在)。我想做的是将“后退”菜单项保留在左侧,并更改“下一个”菜单项的标签。是否可以?
我尝试创建一个带有必要标签的新命令并添加到 stringiteim,但它不会替换 Next 命令,它只是创建一个名为 Menu 的菜单项,其中包含子项 - Next 和我的命令标签。
如何删除 Next 或更改其标签?
I have a StringItem which works like a button. The standard menu items(Back on the left side and Next on the right side are always present). The thing I want to do is to leave Back menu item on the left and change Next menu item's label. Is it possible?
I tried to create a new Command with the necessary label and add to the stringiteim but it doesn't replace Next command, it just creates a menu item called Menu with subitems- Next and My command label.
How can I remove Next or change its label?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
命令 API< /a> 不允许设置新标签,因此您正确猜测的唯一选择是添加新命令。你只是忘了一件事...
...在执行上述操作时,您忘记删除“下一步”命令。替换命令的代码应如下所示:
或者,如果您使用与 Item 关联的命令 (ItemCommandListener API) 而不是 Form,
Command API does not allow to set new label, so your only option as you correctly guessed was to add the new command. You just forgot one thing...
...when doing above, you forgot to remove "Next" command. Code to replace command should be about as follows:
or, if you use commands associated with Item (ItemCommandListener API) instead of Form,