June 2005
Beginner to intermediate
336 pages
6h 29m
English
When the user clicks the Go button, Java will call the actionPerformed method in the RobotProject class. That method is where all the excitement happens in this project.
Everything starts by removing the Robot from the screen, which is done simply by calling the setVisible method of JFrame with a value of false:
public void actionPerformed(ActionEvent e)
{
try{
setVisible(false);
.
.
.
}
When the Robot disappears from the screen, the program the user wants to control regains the focus, so all the Robot has to do is to send keystrokes and mouse events to it.
All that's done with a Java Robot object, and you can see the methods of the Robot class in Table 7.6.
Read now
Unlock full access