Applet problems

  • Thread starter Deleted member 43669
  • Start date
Status
Not open for further replies.
D

Deleted member 43669

Guest
Hiya all,

I'm coding my end-of-career project in Java, a sokoban-solver applet. I have begun implementing the interface, using Swing and PNG's; problem is that I cannot get the applet to work in some setups. You can find it here. It works just fine under Galeon and Blackdown Java, and in Internet Explorer with ze Latest Sun Plugin.

Just trying it out and telling me the results with OS, browser and Java plugin versions, would be a grrrreat help for me.

I'd expect it to work in any browser which shows Sun's Swing demos, but alas, this isn't the case... any ideas? I can provide source code if anyone's interested. My guess is that maybe PNG's are not supported in all versions of Java, but I really don't want to switch to gifs for ethical reasons.

Thanks!
 
java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(ImageIcon.java:134)
at soko.applet.SokobanApplet.init(SokobanApplet.java:58)
at org.kde.kjas.server.KJASAppletStub.initApplet(KJASAppletStub.java:145)
at org.kde.kjas.server.KJASAppletStub$1.run(KJASAppletStub.java:98)
at java.lang.Thread.run(Thread.java:484)

JVM 1.3.1_01 under GNU/Linux using Konqueror

~Kevin
:)
 
D

Deleted member 43669

Guest
java.lang.NullPointerException
at javax.swing.ImageIcon.(ImageIcon.java:134)
at soko.applet.SokobanApplet.init(SokobanApplet.java:58)
at org.kde.kjas.server.KJASAppletStub.initApplet(KJASAppletStub.java:145)
at org.kde.kjas.server.KJASAppletStub$1.run(KJASAppletStub.java:98)
at java.lang.Thread.run(Thread.java:484)

JVM 1.3.1_01 under GNU/Linux using Konqueror

~Kevin
[smile]

Hey! The line in question is:

JButton sobre = new JButton(new ImageIcon((URL) this.getClass().getResource("/grafics/titol.png")));

Which is the first place I load a png.

I am using Blackdown's JVM 1.3.1. Which one are you using?
 
Originally posted by koala:
Hey! The line in question is:

JButton sobre = new JButton(new ImageIcon((URL) this.getClass().getResource("/grafics/titol.png")));

Which is the first place I load a png.

I am using Blackdown's JVM 1.3.1. Which one are you using?


I'm using the one from the Sun website. IIRC there was some sort of a controversy about Sun repacking Blackdown's as their own, but I'm pretty sure this is pure Sun work in action.

Anyhow, I've got libpng2 and 3 installed and Konq can view png's just fine (usually the applet has the browser render the images)

~Kevin
:)
 
Status
Not open for further replies.