Loading...
Logo
Processing Forum
Hello, I'm having a problem trying to view an applet in Safari. I hope you can help me.

I wrote a little sketch called grid_b that uses the controlP5 library to display a Textlabel. Everything works fine until I try to view my exported applet in the browser because It shows blank. I've already made public every field and function which uses the controlP5 library.

I found this error in my systems' console:

Copy code
  1. Exception in thread "Animation Thread" java.lang.NullPointerException
  2. at sun.awt.SunToolkit.createImage(SunToolkit.java:904)
  3. at controlP5.ControlP5IOHandler.loadImage(Unknown Source)
  4. at controlP5.BitFontRenderer.loadFonts(Unknown Source)
  5. at controlP5.BitFontRenderer.<init>(Unknown Source)
  6. at controlP5.Label.<init>(Unknown Source)
  7. at controlP5.Textlabel.<init>(Unknown Source)
  8. at grid_b$Cell.<init>(grid_b.java:59)
  9. at grid_b$Grid.<init>(grid_b.java:96)
  10. at grid_b.setup(grid_b.java:39)
  11. at processing.core.PApplet.handleDraw(PApplet.java:1583)
  12. at processing.core.PApplet.run(PApplet.java:1503)
  13. at java.lang.Thread.run(Thread.java:680)
Any ideas?

Thanks!

Replies(2)

I am using safari 5.0.3 (JRE version 1.6.0_22-b04-307-10M3261 Java HotSpot(TM) 64-Bit Server VM) and works fine for me. 

So what happens is that in your case controlP5's font renderer cant find/load a bit-font image-texture used to display textlabels, the default images are included in the controlP5.jar but maybe  sun.awt.SunToolkit cant find/load them.

Do any of the examples that come with controlP5 work in safari for you? can you load images from a processing sketch (e.g. the LoadDisplayImage example) in your browser at all?

Thanks for your reply!

I tried a few and none of them worked. LoadDisplayImage works fine. I'm using Safari 5.0.3 and Java, well, I found version 1.6.0_22-b04-307 as 64-bit as well as 32-bit in Java Preferences (under /Applications/Utilities). Looking into Safari Installed Plug-ins I find Java Plug-In 2 for NPAPI Browsers and a Switchable Java Plug-in for WebKit.

This is what I get from ControlP5basics (methods and top variables are public):

Copy code
  1. ControlP5 0.5.4 infos, comments, questions at http://www.sojamo.de/libraries/controlP5
  2. Exception in thread "Animation Thread" java.security.AccessControlException: access denied (java.lang.RuntimePermission accessDeclaredMembers)
  3.  at java.security.AccessControlContext.checkPermission(AccessControlContext.java:323)
  4.  at java.security.AccessController.checkPermission(AccessController.java:546)
  5.  at java.lang.SecurityManager.checkPermission(SecurityManager.java:532)
  6.  at java.lang.SecurityManager.checkMemberAccess(SecurityManager.java:1662)
  7.  at java.lang.Class.checkMemberAccess(Class.java:2157)
  8.  at java.lang.Class.getDeclaredMethods(Class.java:1790)
  9.  at controlP5.ControlBroadcaster.checkObject(Unknown Source)
  10.  at controlP5.ControlBroadcaster.<init>(Unknown Source)
  11.  at controlP5.ControlP5.init(Unknown Source)
  12.  at controlP5.ControlP5.<init>(Unknown Source)
  13.  at sketch_jan08a.setup(sketch_jan08a.java:41)
  14.  at processing.core.PApplet.handleDraw(PApplet.java:1583)
  15.  at processing.core.PApplet.run(PApplet.java:1503)
  16.  at java.lang.Thread.run(Thread.java:680)