Loading...
Logo
Processing Forum
Hi there,
I'm currently porting a lib to Processing 2.x and I have no error but this one.

"There is not public mouseEvent() method in the class xxxx"

Actually, I have one:

Copy code
  1. public void mouseEvent(MouseEvent event) {
  2.         int id = event.getID();
  3.         
  4.         switch (id) {
  5.         case MouseEvent.MOUSE_PRESSED:
  6.           mousePressed();
  7.           break;
  8.         case MouseEvent.MOUSE_RELEASED:
  9.           mouseReleased();
  10.           break;
  11.         case MouseEvent.MOUSE_CLICKED:
  12.           mouseClicked();
  13.           break;
  14.         case MouseEvent.MOUSE_DRAGGED:
  15.           mouseDragged();
  16.           break;
  17.         case MouseEvent.MOUSE_MOVED:
  18.           mouseMoved();
  19.           break;
  20.         }


and I'm registering the method like that:

Copy code
  1. parent.registerMethod("mouseEvent"this);

Obviously, I should miss something ...


Anyone ?

Replies(1)

If you have an import statement similar to this
    import java.awt.event.MouseEvent;
or
    import java.awt.event.*;
then remove it.

In 1.5.1 Processing used the java.awt.event.MouseEvent class but this changed to processing.event.MouseEvent in 2.0

BTW move this topic because it was not about a contributed library