"Java MobilePDA Program Design" Reading Note 3 - LCDAUI Advanced API List

xiaoxiao2021-03-06  14

SCREEN class has four subclasses: Alert List Textbox Form

List is divided into: choice.exclusive (select) Choice.MULTIPLE (Multi-Selected) Choice.MPlicit

Single image type image img = image.createImage ("/ a.png"); list l = new list ("list test", choice.exclusive; l.append ("banana", img); l.append (" Apple ", NULL); Display.SetCurrent (L);

INSERT () can insert a new project after a specific project. Set () can reset an item. ... System.out.Println ("You Have Choice the" L.getSelectedIndIndex () "Item."); System.out.Println ("THE Content IS:" L.GetString (L.GetSelected Index ()) );

Multi-selection list l = new list ("List test", choice.multiple; ... int size = L.Size (); for (int i = 0; i <= size; i ) {if (L.Isselected (i)) {system.out.println ("You Have SELECTED" i);}}

GetSelectedFlags () is sent back to a Boolean array, thereby understanding that option is selected.

Simple List List L = New List ("List Test", Choice.Implicit; ...... Public Void CommandAction (Command C, Displayable S) {if (c == list.select_command {List TMP = (List) s ; int i = tmp.getSelectedIndex (); system.out.println ("You Have SELECTED" i)} ...}

Choice.Implicit raises an event immediately after the user is selected, and incorporated the list.select_command through the first parameter C of CommandAction (). If you don't want this, you can turn off it, at this time, c = null.setSelectCommand (x) - x is another Command object, when the List is selected, X as the first parameter of CommandAction () Incoming.

After setSelectCommand (), this Command-X will be automatically added to the system menu by addcommand (). RemoveCommand (c) is like: setSelectCommand (null); RemoveCommand (C);

The Fitpolicy mechanism provided by the Choice interface determines how to handle Choice.Text_Wrap_on-too long text automatic wrap kiice.text_wrap_wrap_default-dependent and different, Usually one of the first two

转载请注明原文地址:https://www.9cbs.com/read-47232.html

New Post(0)