controlP5 - ControlBroadcaster Unknown Source error

I create cp5 objects in buildGUI() method which is called in constructor of VisualController class:

private void buildGUI() {

        cp5.addSlider("maxVelocity")
             .setPosition(20, 20)
             .setSize(guiDefaultWidth,guiDefaultHeight)
             .setValue(10)
             .setRange(0, 10)
             .setLabelVisible(true);
 // ... 
}

then in VisualController class I have methods that use the value from sliders :

public void maxVelocity(float theValue) {
        maxVelocity = theValue;
    }

then in main PApplet I have :

void maxVelocity(float theValue) {
        vic.maxVelocity(theValue);

    }

which calls VisualController respective method.

Code compiles and app is working but it reports below error:

controlP5.ControlBroadcaster printMethodError
SEVERE: An error occured while forwarding a Controller event, please check your code at maxVelocity
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Slider.setValue(Unknown Source)
at controlP5.Slider.setSliderMode(Unknown Source)
at controlP5.Slider.setWidth(Unknown Source)
at controlP5.Slider.setSize(Unknown Source)
at explorer.VisualController.buildGUI(VisualController.java:132)

Why am i getting this error and how could i get rid of it? Many thanks for help.

Sign In or Register to comment.