Images from JAR files - follow up

C

Charles Thomas

Reody said:
It's possible the source of the image is closing the channel before
the image has been fully delivered.

Any idea how to remedy this when reading images from a JAR file?

I believe this to be the case, but don't know how to go about fixing it.
To my knowledge I'm doing everything exactly according to the "book"
when loading my image files.


url = this.getClass().getResource("Images/Splash.jpeg");
if (url != null)
{
splash_image = Toolkit.getDefaultToolkit().getImage(url);
}

mt = new MediaTracker(this);
mt.addImage(splash_image, 0);

try
{
mt.waitForAll();
}
catch (InterruptedException ie)
{
Thread.currentThread().interrupt();
}

Object[] errors = mt.getErrorsAny();
if (errors != null)
{
Settings.main_window.displayMessage("Errors were generated
during splash image loading!");
}


NOTES: splash_image is returned as a non-null and valid object. JPEG
image is present in JAR file and extracts as a valid (non corrupted)
image file.

getErrorsAny() returns an error object, but I don't know how to find out
what it is or what caused it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top