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.