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 › ControlP5: Error in an applet
Page Index Toggle Pages: 1
ControlP5: Error in an applet (Read 1208 times)
ControlP5: Error in an applet
Jan 17th, 2008, 6:36pm
 
Hi,

I have programmed an sketch to draw a mathematical function. There are two parametres of the function that can be changed using two sliders. The sliders are done using ControlP5. The sketch works OK when I run it from the Processing IDE.

The problem is when I export it as an applet and I run it inside the browser. In that case I get the following error in the Java console:

ControlP5 0.2.7 infos, comments, questions at http://www.sojamo.de/controlP5
### WARNING @ ControlP5.invokeField java.lang.IllegalAccessException: Class controlP5.ControlBroadcaster can not access a member of class _2o_Orden with modifiers ""
### WARNING @ ControlP5.invokeField java.lang.IllegalAccessException: Class controlP5.ControlBroadcaster can not access a member of class _2o_Orden with modifiers ""
### WARNING @ ControlP5.invokeField java.lang.IllegalAccessException: Class controlP5.ControlBroadcaster can not access a member of class _2o_Orden with modifiers ""
.. etc etc etc

The generated jar works fine when I run it using:

java -jar _2o_Orden.jar

The applet is available here:

http://web.udl.es/usuaris/w3511782/applet/

and the jar file:

http://web.udl.es/usuaris/w3511782/applet/_2o_Orden.jar

My operating system is a Kubuntu 7.10. Processing is 0135BETA and ControlP5 is 0.2.7.

There is a little more information in this thread:
http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Programs;action=display;num=1200411214

Javier
Re: ControlP5: Error in an applet
Reply #1 - Jan 18th, 2008, 5:29am
 
hi javier,
the error you are getting is due to the security handling in applets. the solution here would be to make your variables z and tao public.
Code:

public float z=.5; // Coeficiente de amortiguamiento
public float tao=.5; // Constante de tiempo


by doing so, controP5 is granted to have access to these variables. you are not getting these errors when not running in a browser since the security handling is less strict in this case.
best,
andi

Re: ControlP5: Error in an applet
Reply #2 - Jan 18th, 2008, 12:10pm
 
Hi,

Thank you. Obviously that solved the problem.

May I suggest you to include that information in the ControlP5 website? Probably it is well known for more experienced Processing programmers but I think that i would be a good piece of advise for novices, like me.

Javier
Re: ControlP5: Error in an applet
Reply #3 - Jan 18th, 2008, 3:36pm
 
thanks javier for the hint, updated the website.
andi
Re: ControlP5: Error in an applet
Reply #4 - Jan 18th, 2008, 11:34pm
 
Great!

Javier
PS. It's a pity I don't know more English. I haven't got enough vocabulary to express how much I hate the blink tag Wink
Page Index Toggle Pages: 1