Java Reference
In-Depth Information
public void startApp() {
Form form = new Form("GaugeTracker");
form.addCommand(new Command("Exit", Command.EXIT, 0));
form.setCommandListener(this);
// Now add the selected items.
form.append(mGauge);
form.append(mStringItem);
form.setItemStateListener(this);
Display.getDisplay(this).setCurrent(form);
}
public void pauseApp() {}
public void destroyApp(boolean unconditional) {}
}
Summary
This chapter described MIDP's advanced user-interface screens,
List
and
Form
. A
List
is a list
of elements that allows for single or multiple selections. You supply the items—it's up to the
implementation to figure out how to show them, how the user navigates through them, and
how the user selects items.
Form
s are generalized screens that are built up from a collection of
Item
s. The MIDP API supplies a handy toolbox of
Item
s—everything from simple string and
image
Item
s to the more complex
DateField
and
ChoiceGroup
classes.
Even though
List
and
Form
are very capable, you should use them sparingly, particularly
Form
. Small devices have small screens, so you don't want to put much information in each
screen, especially if it's going to force the user to scroll up and down a lot. Furthermore, ease of
use is crucial on consumer devices like mobile phones and pagers. Make sure your interface is
clean, intuitive, and as simple as it can possibly be.
Search WWH ::
Custom Search