I am writing a java class to display an image for J2ME application. But catched in exception below:
java.io.IOException
at javax.microedition.lcdui.I
mmutableIm
age.getIma
geFromStre
am(Image.j
ava:968)
at javax.microedition.lcdui.I
mmutableIm
age.<init>
(Image.jav
a:939)
at javax.microedition.lcdui.I
mage.creat
eImage(Ima
ge.java:31
3)
I suspect i did not put the image file at correct folder.
In which folder / directory should i store the image based on the code below? fyi, i am using netbean.
import javax.microedition.lcdui.*
;
import javax.microedition.midlet.
*;
import java.io.IOException;
class SplashScreen extends Alert {
public SplashScreen(Remote remote){
super("Welcome");
this.setTimeout(3000);
try {
this.setImage(Image.create
Image("/mc
d.PNG"));
}
catch (IOException ex) {
ex.printStackTrace();
}
remote.setMainScreen();
}
}
Start Free Trial