|
From: <ka...@us...> - 2011-02-02 22:29:24
|
Revision: 3483
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3483&view=rev
Author: kappa1
Date: 2011-02-02 22:29:18 +0000 (Wed, 02 Feb 2011)
Log Message:
-----------
AppletLoader - tweak image loading to fix cases where it doesn't work
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-01-28 23:06:06 UTC (rev 3482)
+++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2011-02-02 22:29:18 UTC (rev 3483)
@@ -774,7 +774,7 @@
// set lwjgl properties
setLWJGLProperties();
- // switch to LWJGL Applet
+ // make applet switch on EDT as an AWT/Swing permission dialog could be called
EventQueue.invokeAndWait(new Runnable() {
public void run() {
try {
@@ -1556,11 +1556,11 @@
*/
protected Image getImage(String s) {
try {
- URL url = Thread.currentThread().getContextClassLoader().getResource("/"+s);
-
- // if image not found in jar, look outside it
+ URL url = url = new URL(getCodeBase(), s);
+
+ // if image failed to load, try another method
if (url == null) {
- url = new URL(getCodeBase(), s);
+ Thread.currentThread().getContextClassLoader().getResource(s);
}
Image image = super.getImage(url);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|