Java Reference
In-Depth Information
(a)
(b)
Figure 6-1.
List types: (a) EXCLUSIVE and (b) MULTIPLE
Figure 6-2.
IMPLICIT lists combine selection and confirmation.
Event Handling for IMPLICIT Lists
When the user makes a selection in an
IMPLICIT list
, the
commandAction()
method of the
list
's
CommandListener
is invoked. A special value is passed to
commandAction()
as the
Command
parameter:
public static final Command SELECT_COMMAND
For example, you can test the source of command events like this:
public void commandAction(Command c, Displayable s) {
if (c == nextCommand)
// ...
else if (c == List.SELECT_COMMAND)
// ...
}
Search WWH ::
Custom Search