I’m writing a small application in Java that will click ten different locations on my screen each minute for 10 minutes. But before doing the clicking I want to choose the locations it will click by clicking on the screen and storing the x & y coordinates in an arraylist.
I have read that I can get it by using MouseInfo however I want to get the coordinates when the mouse is clicked (which may not include being on the component). So how does one do this?
Will I have to create a see through component that takes up the entire screen and get the coordinates that way? Or is there a better way to go about this?
I decided to just make a translucent window the size of the screen (which is barely visible) and collected the mouse positions that way. It seemed to work, but I was hoping that I wouldn’t have to paint an extra component.
Summarized (for those that care):
So far this seems to be my best option, unless someone else mentions one shortly 🙂