problem to register MouseEvent
in
Library and Tool Development
•
1 year ago
i´m new to this forum and need help..
i use netbeans and i want to create a ui library.
with the method "registerDraw()" and declaring the function "draw()" inside the class, it works properly.
but when i want to "registerMouseEvent()" and declare the function "mouseEvent()" an error occurs.
- Exception in thread "Animation Thread" java.lang.RuntimeException: There is no public mouseEvent() method in the class processing2.sketch$HFader
- at processing.core.PApplet.die(PApplet.java:2571)
- at processing.core.PApplet.registerWithArgs(PApplet.java:974)
- at processing.core.PApplet.registerMouseEvent(PApplet.java:935)
- at processing2.sketch$HFader.<init>(sketch.java:68)
- at processing2.sketch.setup(sketch.java:26)
- at processing.core.PApplet.handleDraw(PApplet.java:1608)
- at processing.core.PApplet.run(PApplet.java:1530)
- at java.lang.Thread.run(Thread.java:680)
- import processing.core.*;
- public class sketch extends PApplet {
- PApplet app = this;
- HFader hf1;
- public void setup() {
- size(600, 600);
- frameRate(30);
- noStroke();
- hf1 = new HFader();
- }
- public void draw() {
- }
- public class HFader {
- HFader() {
- app.registerDraw(this);
- app.registerMouseEvent(this);
- }
- public void draw() {
- println("draw");
- }
- public void mouseEvent(MouseEvent e) {
- println("mouseEvent: " + e);
- }
- }
- }
hope someone can help me.
sorry for the bad english...
regards
1