开发者

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

开发者 https://www.devze.com 2022-12-26 18:55 出处:网络
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开发者_开

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

精彩评论

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

关注公众号