Slide 3.15: Lists
  Slide 3.17: Lists (cont.)
  Home


Lists (Cont.)


List menu;
The class javax.microedition.lcdui.List is a Screen containing list of choices.

menu = new List( "Test Components", Choice.IMPLICIT );
The constructor public javax.microedition.lcdui.List.List(String title, int listType) creates a new, empty List with the following two parameters:
menu.append( "Test TextBox", null );
The method public int javax.microedition.lcdui.List.append(String stringPart, Image imagePart) appends an element to the Choice, which is an interface of the package javax.microedition.lcdui and defines an API for a user interface components implementing selection from predefined number of choices. The added element will be the last element of the Choice.

Ticker ticker = new Ticker( "Test GUI Components" );
The class javax.microedition.lcdui.Ticker implements a “ticker-tape,” a piece of text that runs continuously across the display. The direction and speed of scrolling are determined by the implementation. While animating, the ticker string scrolls continuously. The constructor public Ticker(String str) constructs a new Ticker object, given its initial contents string.

menu.setTicker(ticker);
The method public void javax.microedition.lcdui.Screen.setTicker (Ticker ticker) sets a ticker for use with this Screen, replacing any previous ticker.