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 interface
Choice
{ // public class fields public static final intEXCLUSIVE
= 1; public static final intIMPLICIT
= 2; public static final intMULTIPLE
= 3; // public instance methods public intappend
(String stringPart, Image imagePart); public voiddelete
(int elementNum); public ImagegetImage
(int elementNum); public intgetSelectedFlags
(boolean[] selectedArray); public intgetSelectedIndex
( ); public StringgetString
(int elementNum); public voidinsert
(int elementNum, String stringPart, Image imagePart); public booleanisSelected
(int elementNum); public voidset
(int elementNum, String stringPart, Image imagePart); public voidsetSelectedFlags
(boolean[] selectedArray); public voidsetSelectedIndex ...
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.