Java examples for java.awt:Robot
Robot left Click Down
//package com.java2s; import java.awt.AWTException; import java.awt.Robot; import java.awt.event.MouseEvent; public class Main { public static void leftClickDown(boolean down) { try {/*from w w w . j a v a2s. co m*/ Robot robot = new Robot(); if (down) { robot.mousePress(MouseEvent.BUTTON1_DOWN_MASK); } else { robot.mouseRelease(MouseEvent.BUTTON1_DOWN_MASK); } } catch (AWTException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }