Breaking News
Home / Java / Java Snippets / Howto programatically move mouse?

Howto programatically move mouse?

Mouse AutomationThis snippet shows how to move or re-position the mouse on the screen. This involves the use of Robot API available as part of java.awt package. Basically using the robot.mouseMove(x, y) method the mouse pointer can be repositioned anywhere on the screen.

In addition it also show how to move simulate the mouse wheel movement, which creates a window scroll effect in the current window.

Using these techniques Automation can be achieved, by positioning the mouse on a button and invoking the keyPress(.) and keyRelease() method for the Robot as well, simulating a human click.

 

[pb_builder]

Check Also

How to progamatically get the Java version?

Snippet The key here is to use the system property java.version and get minor and …

Advertisment ad adsense adlogger