Form with an Image Item
Description:
The following code creates a Form with an Image Item.
import java.io.IOException;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Image_Item extends MIDlet
{
Display display=Display.getDisplay(this);
public void startApp()
{
Form form = new Form("Form example");
try
{
Image Logo = Image.createImage("/images/logo.png");
//ImageItem(label,Image,layout,alternative text)
ImageItem imageitem =new ImageItem("ImageItem Example",Logo,ImageItem.LAYOUT_CENTER,"");
form.append(imageitem);
}
catch (IOException ex)
{
System.out.println("Exception occurred: "+ex);
}
display.setCurrent(form);
}
}

