在LWUIT中获取选中的RadioButton
嘿人们?我在 J2ME 平台上使用 LWUIT 从两个 RadionButton
(男性和女性)获取所选项目时遇到了挑战。
RadioButton selected = genderGroup.getRadioButton(genderGroup.getSelectedIndex());
String selectedGender = selected.toString();
我尝试了上面的代码块,但从未得到我所期望的结果。
有人可以帮我一下吗?
问候, 凯文.
Hey people? I have a challenge in getting the selected item from two RadionButtons
(male and Female) using LWUIT on the J2ME platform.
RadioButton selected = genderGroup.getRadioButton(genderGroup.getSelectedIndex());
String selectedGender = selected.toString();
I tried the block of code above but never got what I expected.
Would someone please give me a hand.
Regards,
Kevin.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我想您想要从
RadioButton
中提取的是与此RadioButton
关联的文本。为此,您需要使用getText()
而不是toString()
。这就是你想做的吗?
I suppose what you want to extract from the
RadioButton
is the text associated to thisRadioButton
. To do this you need to usegetText()
insteadtoString()
.Is that what you want to do?
嘿 kevintich 请使用此代码...
hey kevintich Please use This Code...