Name

javax.microedition.lcdui.Choice

Synopsis

This interface defines an API for user interface components, such as List and ChoiceGroup, implementing selection from a predefined number of choices. Each element of a choice is composed of a text string and an optional image. If you do not want the element to have an image, pass in null.

There are three types of choices:

EXCLUSIVE

Presents a series of elements and interacts with the user. When the user selects an element, it is shown to be selected using a distinct visual representation. Exactly one element must be selected at any given time.

IMPLICIT

Serves as an EXCLUSIVE choice where the focused element is implicitly selected when a command is initiated.

MULTIPLE

Presents a series of elements and allows the user to select multiple elements.

public interfaceChoice {
   // public class fields
   public static final int EXCLUSIVE = 1;
   public static final int IMPLICIT = 2;
   public static final int MULTIPLE = 3;
   // public instance methods
   public int append(String stringPart, Image imagePart);
   public void  delete(int elementNum);
   public Image getImage(int elementNum);
   public int getSelectedFlags(boolean[] selectedArray);
   public int getSelectedIndex(  );
   public String getString(int elementNum);
   public void insert(int elementNum, String stringPart, Image imagePart);
   public boolean isSelected(int elementNum);
   public void set(int elementNum, String stringPart, Image imagePart);
   public void setSelectedFlags(boolean[] selectedArray);
   public void setSelectedIndex ...

Get Wireless Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.