AppletLoader - another attempt to fix the logo. Thx again to arielsan for spotting issues.

This commit is contained in:
kappa1 2011-02-03 22:12:41 +00:00
parent 48650a6e02
commit 26f22532eb
1 changed files with 31 additions and 10 deletions

View File

@ -1555,14 +1555,38 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
* @return the Image file
*/
protected Image getImage(String s) {
Image image = null;
try {
URL url = url = new URL(getCodeBase(), s);
// if image failed to load, try another method
if (url == null) {
url = Thread.currentThread().getContextClassLoader().getResource(s);
}
image = getImage(new URL(getCodeBase(), s));
} catch (Exception e) {
/* */
}
// if image failed to load, try another method
if (image == null) {
image = getImage(Thread.currentThread().getContextClassLoader().getResource(s));
}
// if image loaded sucessfully return it
if (image != null) {
return image;
}
// show error as image could not be loaded
fatalErrorOccured("Unable to load logo and progressbar images", null);
return null;
}
/**
* Get Image from path provided
*
* @param url location of the image
* @return the Image file
*/
public Image getImage(URL url) {
try {
Image image = super.getImage(url);
// wait for image to load
@ -1577,13 +1601,10 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
} catch (Exception e) {
/* */
}
// show error as image could not be loaded
fatalErrorOccured("Unable to load logo and progressbar images", null);
return null;
}
/**
* Get jar name from URL.
*