Java Robot.mouseWheel(int wheelAmt)
Syntax
Robot.mouseWheel(int wheelAmt) has the following syntax.
public void mouseWheel(int wheelAmt)
Example
In the following code shows how to use Robot.mouseWheel(int wheelAmt) method.
// ww w . ja v a 2s .c om
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);
}
}
Home »
Java Tutorial »
java.awt »
Java Tutorial »
java.awt »