simulate mouse click java

Solutions on MaxInterview for simulate mouse click java by the best coders in the world

showing results for - "simulate mouse click java"
Malena
12 Nov 2020
1import java.awt.event.*;
2import java.awt.Robot;
3public class test {
4 public static void main(String args[]) {
5  Robot bot = null;
6  try {
7   bot = new Robot();
8  } catch (Exception failed) {
9   System.err.println("Failed instantiating Robot: " + failed);
10  }
11  int mask = InputEvent.BUTTON1_DOWN_MASK;
12  bot.mouseMove(100, 100);
13  bot.mousePress(mask);
14  bot.mouseRelease(mask);
15 }
16}
17