Tips and Tricks

Java provides a lot of fun while programming. This article shows you how to use Java.awt.Robot class that is both useful and fun.

Tips and Tricks

Tips and Tricks

       

 

Opening, writing, saving notepad automatically with Robot class in Java

Java provides a lot of fun while programming. This article shows you how to use Java.awt.Robot class that is both useful and fun. Robot class is used to take the control of mouse and keyboard, which lets you do any mouse and keyboard related operation through java code for the purposes of test automation, self-running demos. The sample code given below demonstrates handling of the keyboard events. When this program is run, it does a series of events automatically. It opens notepad and types ?javajazzup? in it and saves this file as ?robo.txt? automatically.
  

Now, read details at:

http://www.javajazzup.com/issue6/page70.shtml