|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.microedition.lcdui.Displayable javax.microedition.lcdui.Screen javax.microedition.lcdui.List ch.aplu.gidlet.MList
public class MList
List display with simple input and output items.
A soft button 'Exit' is shown. Hitting the corresponding key will
call the Gidlet's doExit(). If you do not need this button,
invoke removeExitButton().
If you implement your own CommandListener and call setCommandListener(), the internal
CommandListener is disabled.
main() serves as entry point for the user programm. It is called in the run-method
of a separate thread and should terminate to avoid non-terminated threads.
Creation may take place within main() or while declaring instance variable of
the application program.
Example:
import ch.aplu.gidlet.*;
import javax.microedition.lcdui.*;
public class ListSelectGidlet extends Gidlet
{
private MList list = new MList("Email");
public void main()
{
list.append("Read", null);
list.append("Reply", null);
list.append("Delete", null);
list.show();
}
public void doOk()
{
int index = list.getSelectedIndex();
String selection = list.getString(index);
showMessage(selection);
}
}
Field Summary |
---|
Fields inherited from class javax.microedition.lcdui.List |
---|
SELECT_COMMAND |
Fields inherited from interface javax.microedition.lcdui.Choice |
---|
EXCLUSIVE, IMPLICIT, MULTIPLE, POPUP, TEXT_WRAP_DEFAULT, TEXT_WRAP_OFF, TEXT_WRAP_ON |
Constructor Summary | |
---|---|
MList()
Constructs a MList with no title and list type IMPLICIT. |
|
MList(java.lang.String title)
Constructs a MList with given title and list type IMPLICIT. |
Method Summary | |
---|---|
void |
addOkButton()
Adds an OK soft button with label "OK". |
void |
addOkButton(java.lang.String label)
Adds an OK soft button with given label. |
void |
removeExitButton()
Removes Exit soft button. |
void |
removeOkButton()
Removes Ok soft button. |
void |
show()
Shows the form display if it is not yet visible or it was previously hidden by another display. |
void |
show(boolean wait)
Shows the list display if it is not yet visible or it was previously hidden by another display. |
Methods inherited from class javax.microedition.lcdui.List |
---|
append, delete, deleteAll, getFitPolicy, getFont, getImage, getSelectedFlags, getSelectedIndex, getString, getTicker, insert, isSelected, removeCommand, set, setFitPolicy, setFont, setSelectCommand, setSelectedFlags, setSelectedIndex, setTicker, setTitle, size |
Methods inherited from class javax.microedition.lcdui.Displayable |
---|
addCommand, getHeight, getTitle, getWidth, isShown, setCommandListener, sizeChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MList(java.lang.String title)
public MList()
Method Detail |
---|
public void show()
public void show(boolean wait)
public void addOkButton()
public void addOkButton(java.lang.String label)
public void removeExitButton()
public void removeOkButton()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |