Use List option to hold choice : List « J2ME « Java Tutorial






Use List option to hold choice
import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;

public class PaymentMIDlet extends MIDlet {
  private Display display;

  List options = new List("Method of Payment", Choice.EXCLUSIVE);

  public void startApp() {
    display = Display.getDisplay(this);
    options.append("Visa", null);
    options.append("MasterCard", null);
    options.append("Amex", null);
    display.setCurrent(options);
  }

  public void pauseApp() {
  }

  public void destroyApp(boolean unconditional) {
  }
}








31.11.List
31.11.1.Use List
31.11.2.Use List option to hold choiceUse List option to hold choice
31.11.3.List with strings and images
31.11.4.Implicit MenuImplicit Menu
31.11.5.List check boxList check box
31.11.6.List radio buttonList radio button