EditorMouseFixture () { int oldLastId = myLastId; int clickCount = myLastId == MouseEvent.MOUSE_PRESSED ? myLastClickCount : 0; myLastComponent.dispatchEvent(new MouseEvent(myLastComponent, myLastId = MouseEvent.MOUSE_RELEASED, System.currentTimeMillis(), myModifiers | getModifiersForButtonRelease(myButton), myX, myY, myLastClickCount = clickCount, myButton == MouseEvent.BUTTON3, // Windows behaviour myButton)); if (oldLastId == MouseEvent.MOUSE_PRESSED) { myLastComponent.dispatchEvent(new MouseEvent(myLastComponent, myLastId = MouseEvent.MOUSE_CLICKED, System.currentTimeMillis(), myModifiers | getModifiersForButtonRelease(myButton), myX, myY, clickCount, false, // Windows behaviour myButton)); } myLastComponent = null; return this; }