Advertisement

04.30.2007 at 07:40AM PDT, ID: 22542606
[x]
Attachment Details

J2ME application to display image

Asked by isuhendro in Java 2 Micro-Edition (J2ME)

Tags: , ,

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.ImmutableImage.getImageFromStream(Image.java:968)
        at javax.microedition.lcdui.ImmutableImage.<init>(Image.java:939)
        at javax.microedition.lcdui.Image.createImage(Image.java:313)

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.createImage("/mcd.PNG"));
        }
        catch (IOException ex) {
            ex.printStackTrace();
        }    
        remote.setMainScreen();
    }
   
}Start Free Trial
 
Loading Advertisement...
 
[+][-]04.30.2007 at 09:51AM PDT, ID: 19002718

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.29.2007 at 04:12AM PDT, ID: 19171339

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.03.2007 at 07:55PM PDT, ID: 19205918

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java 2 Micro-Edition (J2ME)
Tags: j2me, image, display
Sign Up Now!
Solution Provided By: Computer101
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32