StringItem with line break : StringItem « J2ME « Java Tutorial






StringItem with line break
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.StringItem;
import javax.microedition.midlet.MIDlet;

public class FormStringItemLineBreakMIDlet extends MIDlet {
  protected Display display;

  protected void startApp() {
    display = Display.getDisplay(this);

    Form form = new Form("Item Layout");

    form.append("line");

    form.append(new StringItem(null, "No\n label\n"));

    display.setCurrent(form);
  }

  protected void pauseApp() {
  }

  protected void destroyApp(boolean unconditional) {
  }
}








31.4.StringItem
31.4.1.Add StringItem to a formAdd StringItem to a form
31.4.2.StringItem with line breakStringItem with line break
31.4.3.Get Label and text from StringItemGet Label and text from StringItem
31.4.4.Create Form with a list of StringItemsCreate Form with a list of StringItems
31.4.5.Set new text value to StringItemSet new text value to StringItem