|
From: <ka...@us...> - 2011-02-03 22:12:47
|
Revision: 3485
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3485&view=rev
Author: kappa1
Date: 2011-02-03 22:12:41 +0000 (Thu, 03 Feb 2011)
Log Message:
-----------
AppletLoader - another attempt to fix the logo. Thx again to arielsan for spotting issues.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-02-03 09:35:00 UTC (rev 3484)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-02-03 22:12:41 UTC (rev 3485)
@@ -1555,14 +1555,38 @@
* @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 @@
} 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.
*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|