ButtonGroup 和资源编辑器
我们正在尝试尽可能多地使用 LWUIT 资源编辑器创建应用程序,也就是说,如果可以的话,避免通过代码创建 UI。
我们发现可以通过在资源编辑器工具上设置相应的属性来将组分配给 RadioButton
。
因此,当我们需要为这些单选按钮实现一些功能时,我们如何获取对 UIBuilder 创建的 ButtonGroup 实例的引用(我想)?
是的,考虑到我们使用资源编辑器工具来生成 midlet,“自定义”代码是在 StateMachine 类上编写的。
问候。
We are trying to create an application using the LWUIT Resource Editor as much as possible, it's to say, avoiding creating the UI by code if we can.
We found out there is the possibility to assign a group to a RadioButton
by setting the corresponding property on the Resource Editor tool.
So, as we need to implement some functionality for those radio buttons, how can we get the reference to that ButtonGroup instance that the UIBuilder
has created (I suppose)?
And yes, considering we are using the Resource Editor tool to generate our midlets, the "custom" code is written on the StateMachine
class.
Regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
AFAIK 您无法从 ResourceEdit#GUI 获取
ButtonGroup
。您只能获取RadioButton
组名称。但可以通过代码将RadioButton
添加到ButtonGroup
中。请参阅以下代码,用于调用
StateMachine()
构造函数(在构造函数内部使用此代码),用于调用
StateMachine(String resFile)
构造函数(在 MIDlet 内部使用此代码)班级),AFAIK you can't get
ButtonGroup
from ResourceEdit#GUI. You can only possible to getRadioButton
group name. But possible to add theRadioButton
intoButtonGroup
through your code. See the following code,For calling
StateMachine()
constructor(use this code inside of constructor),For calling
StateMachine(String resFile)
constructor(use this code inside of your MIDlet class),