Skip to content

Instantly share code, notes, and snippets.

@mkotsur
Created December 31, 2011 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkotsur/1543594 to your computer and use it in GitHub Desktop.
Save mkotsur/1543594 to your computer and use it in GitHub Desktop.
Simple tool for determining cursor coordinates
import java.awt.MouseInfo;
import java.awt.Point;
public class Coords {
public static void main(String args[]) throws Exception {
while (true) {
Point spot = MouseInfo.getPointerInfo().getLocation();
System.out.println(String.valueOf(spot.getX()) + "," + String.valueOf(spot.getY()));
Thread.sleep(10);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment