AppletLoader - tweak image loading to fix cases where it doesn't work
This commit is contained in:
parent
f8fbb34f22
commit
9e26e3ef59
|
@ -774,7 +774,7 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
||||||
// set lwjgl properties
|
// set lwjgl properties
|
||||||
setLWJGLProperties();
|
setLWJGLProperties();
|
||||||
|
|
||||||
// switch to LWJGL Applet
|
// make applet switch on EDT as an AWT/Swing permission dialog could be called
|
||||||
EventQueue.invokeAndWait(new Runnable() {
|
EventQueue.invokeAndWait(new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
|
@ -1556,11 +1556,11 @@ public class AppletLoader extends Applet implements Runnable, AppletStub {
|
||||||
*/
|
*/
|
||||||
protected Image getImage(String s) {
|
protected Image getImage(String s) {
|
||||||
try {
|
try {
|
||||||
URL url = Thread.currentThread().getContextClassLoader().getResource("/"+s);
|
URL url = url = new URL(getCodeBase(), s);
|
||||||
|
|
||||||
// if image not found in jar, look outside it
|
// if image failed to load, try another method
|
||||||
if (url == null) {
|
if (url == null) {
|
||||||
url = new URL(getCodeBase(), s);
|
Thread.currentThread().getContextClassLoader().getResource(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
Image image = super.getImage(url);
|
Image image = super.getImage(url);
|
||||||
|
|
Loading…
Reference in New Issue