ImageItem.LAYOUT_LEFT : ImageItem « javax.microedition.lcdui « Java by API





ImageItem.LAYOUT_LEFT

 




import java.io.IOException;

import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.ImageItem;
import javax.microedition.midlet.MIDlet;

public class ImageItemLAYOUT_LEFT extends MIDlet {
  protected Display display;

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

    Form form = new Form("Demo");

    form.append("line");
    try {
      Image red = Image.createImage("/red.png");
      form.append(new ImageItem("Left", red, ImageItem.LAYOUT_LEFT, null));
    } catch (IOException ex) {
      form.append("Failed to load images");
    }
    display.setCurrent(form);
  }

  protected void pauseApp() {
  }

  protected void destroyApp(boolean unconditional) {
  }
}

   
  










Related examples in the same category

1.ImageItem.LAYOUT_CENTER
2.ImageItem.LAYOUT_DEFAULT
3.ImageItem.LAYOUT_NEWLINE_AFTER
4.ImageItem.LAYOUT_NEWLINE_BEFORE
5.ImageItem.LAYOUT_RIGHT
6.new ImageItem(String label, Image img, int layout, String altText)