How to create a Processing 2 P3D web Applet?

edited May 2016 in Library Questions

I need to export a web application that uses toxiclibs, hemesh and other libraries.

Is that not possible when using Processing 2, and should I just stick to Processing 1.5.1?

I managed to create an applet when using JAVA2D, but with P3D it stays blank. I export from Eclipse.

If it's not possible, what changed on P3D between 1.5.1 and 2 to make it harder to achieve?




  • Answer ✓

    The first question you should ask yourself is: do you really want to deploy as an applet? They've basically been killed. Maybe deploying as a packaged jar or executable would be better?

    If you really want to try deploying as an applet, you need to figure out what's going on. You say you have a blank applet, but what errors are printing out to the Java console?

  • edited June 2014
    • In Processing 1.x.x series, only OPENGL renderer used OpenGL.
    • In Processing 2.x.x series, only JAVA2D renderer isn't OpenGL.
    • Also, the OpenGL version in 2.x.x is higher than 1.x.x's. Dunno exactly those version numbers though.
  • @KevinWorkman I don't really want to deploy an applet, but the client wants a version that runs on a web page. Converting everything to JS is too much work, and the performance would probably suffer too much.

    The console was a good point. I was seeing nothing, but only because I was connecting the console to the application afterwards. I found out that in Oracle Java 7 Plugin Control Panel I could enable the console, so it now opens automatically and shows this:

    Exception in thread "Animation Thread" java.lang.ExceptionInInitializerError
        at processing.opengl.PJOGL.initSurface(
        at processing.opengl.PGraphicsOpenGL.initPrimary(
        at processing.opengl.PGraphicsOpenGL.requestDraw(
    Caused by: access denied ("" "<all permissions>" "<all actions>")
        at java.lang.SecurityManager.checkPermission(
        at sun.plugin2.applet.AWTAppletSecurityManager.checkPermission(Unknown Source)
        at com.jogamp.common.util.SecurityUtil.checkPermission(
        at com.jogamp.common.util.SecurityUtil.checkAllPermissions(
        at com.jogamp.common.util.PropertyAccess.addTrustedPrefix(
        at jogamp.opengl.Debug.access$000(
        at jogamp.opengl.Debug$
        at Method)
        at jogamp.opengl.Debug.<clinit>(
        ... 6 more

    I'll investigate the security settings and the signing of the applet.

    Thanks, also @GoToLoop for the details.

  • Converting everything to JS is too much work,...

    If it ever comes to this, I advise you to try out CoffeeScript mode, since it got a class structure close to Java's. *-:)
    Also you'd have access to any other JavaScript libraries. Perhaps similar to Toxic & Hemesh. Who knows? :-?

  • You might want to talk to your client about what an applet actually is. There are going to be warning popup messages with an applet, which really hurts the user experience.

    It looks like you at least have a direction to go in with the security problem. You might have to look into how you're deploying the applet, how you're signing the jar, all that drama.

Sign In or Register to comment.