i used this code :
////////////////////
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class ImmutableImageFromFile extends MIDlet implements CommandListener
{
private Display display;
private Form fmMain;
private Command cmExit;
public ImmutableImageFromFile()
{
display = Display.getDisplay(this);
cmExit = new Command("Exit", Command.EXIT, 0);
fmMain = new Form("");
fmMain.addCommand(cmExit);
fmMain.setCommandListener(this);
try
{
Image im = Image.createImage("1.jpg");
fmMain.append(new ImageItem("asd", im,ImageItem.LAYOUT_DEFAULT, "asdf"));
display.setCurrent(fmMain);
}
catch (java.io.IOException e)
{
e.printStackTrace();
}
}
public void startApp()
{
display.setCurrent(fmMain);
}
public void pauseApp()
{
}
public void destroyApp(boolean unconditional)
{
}
public void commandAction(Command c, Displayable s)
{
if (c == cmExit)
{
destroyApp(false);
notifyDestroyed();
}
}
}
\\\\\\\\\\\\\\\
on running it i got this exception :
///////////////
java.io.IOException
at javax.microedition.lcdui.ImmutableImage.getImageFromStream(+15)
at javax.microedition.lcdui.ImmutableImage.<init>(+20)
at javax.microedition.lcdui.Image.createImage(+8)
at ImmutableImageFromFile.<init>(+75)
at java.lang.Class.runCustomCode(+0)
at com.sun.midp.midlet.MIDletState.createMIDlet(+19)
at com.sun.midp.midlet.Selector.run(+22)
////////////////
What does that mean?