Robot: mousePress(int buttons) : Robot « java.awt « Java by API






Robot: mousePress(int buttons)

 
import java.awt.Robot;
import java.awt.event.InputEvent;

public class MainClass {

  public static void main(String[] args) throws Exception{

    Robot r = new Robot();
    r.mouseMove(35,35);
    r.mousePress( InputEvent.BUTTON1_MASK );
    r.mouseRelease( InputEvent.BUTTON1_MASK );
    Thread.sleep(50);
    r.mousePress( InputEvent.BUTTON1_MASK );
    r.mouseRelease( InputEvent.BUTTON1_MASK );
  }
}
           
         
  








Related examples in the same category

1.Robot: createScreenCapture(Rectangle screenRect)
2.Robot: getPixelColor(int x, int y)
3.Robot: keyPress(int keycode)
4.Robot: keyRelease(int keycode)
5.Robot: mouseMove(int x, int y)
6.Robot: mouseRelease(int buttons)
7.Robot: mouseWheel(int wheelAmt)