开发者

How do we add ChoiceGroups dynamically in Java ME (CLDC) based on the answer to previous choice group values

I am developing a Java ME application for CLDC devices. I have a requirement where the questions are generated based on the previous response. I would start with one choicegroup and then based开发者_开发技巧 on the answer to this choices give another set of question to the user- Kind of Yes/No- If Yes this question or No this question. How do we do that? Am novice in mobile app development. Any help in terms of ideas or blog posts or articles is much appreciated and is of great help.


Read the MIDP2.0 javadocs, and set aside some time to just experiment with the LCDUI APIs and become familiar with how the different components work. Are you comfortable with the difference between a Form and a List, or a Screen and an Item?

These classes in particular can sometimes be slightly surprising and confusing in how they behave. They also often generate quite different results depending on platform.

What you are looking for can be achieved by doing something like adding an ItemStateListener to your form, whose itemStateChanged() method will get called whenever your first ChoiceGroup gets touched. Add your next form elements in that method based on whatever action has been performed on the ChoiceGroup.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜