Using ControlP5 with processing in eclipse results in IllegalArgumentException on keypress
in
Contributed Library Questions
•
1 year ago
I have a Processing project making use of the ControlP5 library running within eclipse in which, upon any keypress on the keyboard, crashes with an IllegalArgumentException:
- Exception in thread "Animation Thread" java.lang.IllegalArgumentException: argument type mismatch
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
- at java.lang.reflect.Method.invoke(Unknown Source)
- at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1076)
- at processing.core.PApplet.handleKeyEvent(PApplet.java:2848)
- at processing.core.PApplet.dequeueKeyEvents(PApplet.java:2793)
- at processing.core.PApplet.handleDraw(PApplet.java:2132)
- at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:197)
- at processing.core.PApplet.run(PApplet.java:1998)
- at java.lang.Thread.run(Unknown Source)
The program (running in an applet) runs perfectly fine with mouse dragging, sliders, etc, until a key is pressed. It seems like there is some sort of unknown keylistener waiting for input and using it incorrectly? It is difficult to tell because the exception refers to java code which is unrelated to the processing code which I wrote.
Even if I have a program which only defines a ControlP5 object, the program encounters the same error:
- import processing.core.*;
- import controlP5.*;
- public class Lensing extends PApplet {
- ControlP5 controlP5;
- public Lensing() {
- }
- public void setup() {
- controlP5 = new ControlP5(this);
- }
- public void draw() {
- }
- public static void main(String args[]) {
- PApplet.main(new String[] { "--present", "edu.umd.astro.Lensing" });
- }
- }
Comment out the single controlP5 definition, and no exception occurs. Any ideas?
1