We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Applet Export Problems
Page Index Toggle Pages: 1
Applet Export Problems (Read 1223 times)
Applet Export Problems
Aug 3rd, 2009, 11:19am
 
Hi everyone,

I have written a simple sketch to rotate/morph the RGB palette. It runs perfectly fine directly from Processing and as an OsX Application (I haven't checked any other OSes, none available). However, when I try to export an applet and run it from a browser (tried Safari and Firefox 3.5) it crashes with the following written to the java console:

2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348] Exception in thread "Animation Thread" java.lang.NullPointerException
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at RGBMorpher.setup(RGBMorpher.java:57)
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at processing.core.PApplet.handleDraw(PApplet.java:1403)
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at processing.core.PApplet.run(PApplet.java:1328)
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at processing.core.PApplet.run(PApplet.java:1328)
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at processing.core.PApplet.run(PApplet.java:1328)
2009-08-03 20.10.14 [0x0-0x23023].com.apple.Safari[348]  at java.lang.Thread.run(Thread.java:613)

The applet is available here:

http://youngstarving.com/dump/rgbmorpher_broken/

And the sketch here:

http://youngstarving.com/dump/rgbmorpher_broken/rgbmorpher.zip

Can anyone help me out? What am I missing? I'm guessing I've messed up something related to file permissions but I can't really spot the error myself.

Thanks in advance!
Re: Applet Export Problems
Reply #1 - Aug 3rd, 2009, 3:07pm
 
Hi,

actually, the
Code:
frame.setTitle("RGB Morpher by Young Starving"); 


line is causing the problem. Just comment it out and you're done.

I think what got you (and me) confused, was that the error message says something about line 57 being wrong. Well that not line 57 of the sketch, but line 57 of the Java code generated from the sketch. When you export the sketch, you can see the generated Java source in the applet folder of your sketch.  Look for line 57 there.
Re: Applet Export Problems
Reply #2 - Aug 4th, 2009, 12:59am
 
Thanks Alvaro! Smiley That did the trick. I didn't know about the new source file, will definitely come in handy when debugging in the future.

It's working like a dream now:

http://www.youngstarving.com/content/rgbmorpher/
Page Index Toggle Pages: 1