Harry Martland
Harry Martland

Reputation: 624

Java auto mouse

I am making a program which plays minesweeper automaticaly. I am using the mouse press function to click the squares. Is there a way of giving focus to the minesweeper program without clicking on the tab at the bottom of the monitor??? Thanks

Upvotes: 0

Views: 964

Answers (2)

camickr
camickr

Reputation: 324167

Is there a way of giving focus to the minesweeper program without clicking on the tab at the bottom of the monitor?

You mean the Windows task bar?

An application automatically gets focus when it is started. If the user clicks on another applcation then the user must also request focus to go back to the application by clicking on the task bar or by using Alt-Tab.

If your program doesn't have focus then you can't just grab focus, because the user is in control of the desktop and not your program.

Upvotes: 1

Jigar Joshi
Jigar Joshi

Reputation: 240948

You can simulate mouse click using Robot (not rajni :P).

Upvotes: 3

Related Questions