postEvent(createMouseEvent(MouseEvent.MOUSE_ENTERED, 0, x, y, modifiers));
postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));
if (numberOfClicks > 0) {
for (int i = 0; i < numberOfClicks; i++) {
postEvent(createMouseEvent(MouseEvent.MOUSE_PRESSED, i + 1, x, y, modifiers));
new Snooze(5);
postEvent(createMouseEvent(MouseEvent.MOUSE_RELEASED, i + 1, x, y, modifiers));
postEvent(createMouseEvent(MouseEvent.MOUSE_CLICKED, i + 1, x, y, modifiers));
new Snooze(10);
}
postEvent(createMouseEvent(MouseEvent.MOUSE_MOVED, 0, x, y, modifiers));
postEvent(createMouseEvent(MouseEvent.MOUSE_EXITED, 1, x, y, modifiers));
} else {
new Snooze(hoverDelay);
}
}