Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

How to create ChoiceGroup in LCDUI

From Wiki
Jump to: navigation, search
Article Metadata
Created: senthilkumar05 (26 Dec 2007)
Last edited: hamishwillee (08 Aug 2013)

Needs-update.pngThis article needs to be updated: If you found this article useful, please fix the problems below then delete the {{ArticleNeedsUpdate}} template from the article to remove this warning.

Reasons: hamishwillee (27 Sep 2012)
The article has no explanation of what it does other than the heading. It should be extended to state the type of choice group created, display and image and link to reference documentation. It should perhaps be merged with Choice group

import javax.microedition.lcdui.*;
import javax.microedition.midlet.MIDlet;
public class ChoiceMidlet extends MIDlet implements CommandListener {
Command exit = new Command("Exit", Command.EXIT, 1);
private Display display;
private boolean firsttime;
private Form form;
String[] stringArray = {"Choice A", "Choice B", "Choice C"};
public ChoiceMidlet() {}
protected void startApp() {
display = Display.getDisplay(this);
form = new Form("Choice Midlet");
ChoiceGroup[] groups = {
new ChoiceGroup("Exclusive",
ChoiceGroup.EXCLUSIVE, stringArray,null),
new ChoiceGroup("Multiple",
ChoiceGroup.MULTIPLE, stringArray,null),
new ChoiceGroup("Pop-Up",
ChoiceGroup.POPUP, stringArray,null)
for (int i = 0; i < groups.length; i++) {
public void commandAction(Command c, Displayable d) {
if (c == exit) {
protected void destroyApp(boolean unconditional) {}
protected void pauseApp() {}
This page was last modified on 8 August 2013, at 04:47.
38 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.