June 2005
Beginner to intermediate
336 pages
6h 29m
English
There are a few last items to take care of in the Robot project. To end the switch statement, the code displays an error message if it can't understand an entered command. Also, the try statement that encloses all the Robot operations ends with a catch statement that reports any errors. And at the very end of the code, the setVisible method of JFrame brings the Robot back into view:
default: System.out.println( "I didn't understand that command."); } catch (Exception ex){System.out.println("Error: " + ex.getMessage());} setVisible(true); }
That completes the code—you're ready to start running other programs via remote control, sending keystrokes and mouse events, taking screen shots, and more. There's a lot of power ...
Read now
Unlock full access