Robot: mouseWheel(int wheelAmt) : Robot « java.awt « Java by API






Robot: mouseWheel(int wheelAmt)

 

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

public class Main {
  public static void main(String[] args) throws Exception {
    Robot robot = new Robot();

    robot.mouseMove(200, 200);

    robot.mousePress(InputEvent.BUTTON1_MASK);
    robot.mouseRelease(InputEvent.BUTTON1_MASK);
    robot.mouseWheel(-100);
  }
}
 

   
  








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: mousePress(int buttons)
7.Robot: mouseRelease(int buttons)