开发者

Choice.IMPLICIT and Choice.EXCLUSIVE in J2ME

Why we can't use Choice.IMPLICIT with in a Form while we can use Choice.EXCLUSIVE. When I use Choice.IMPLICIT, it 开发者_StackOverflow社区gives me a java.lang.IllegalArgumentException

 ChoiceGroup msgChoGrp = new ChoiceGroup("", Choice.EXCLUSIVE);


You can use Choice Implicit with List just check Choice Implicit example with List Thanks


Implicit is for list

and exclusive for choice group

may be you use form so implicit cant be applied :D


The way you use (mis-use) the MIDP 2 API, IAE is the correct behavior because it is exactly what API javadocs require for ChoiceGroup(String label, int choiceType):

Throws: IllegalArgumentException - if choiceType is not one of EXCLUSIVE, MULTIPLE, or POPUP

By the way if all you want is to get rid of radio-buttons and check-boxes, try POPUP kind of ChoiceGroup. If you need to get even closer to implicit List, if you need this really badly, consider CustomItem - though this might require thorough study of API to implement correctly

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜