Posts

Showing posts from June, 2011

Screenshot of our program from our Program

Image
Lets try to take Screenshot of our program from our Program. It sound weired right. Thats what we will try to attempt in this post. Always operating system tries to take a screenshot when we press PrtScn in keyboard. This time lets make our Java program to take the screenshot. As usual we will just brush up few library's and methods required to create this java program.  1) getScreenSize method in Java.awt.toolkit : Gets the size of the screen. On systems with multiple displays, the primary display is used. Multi-screen aware display dimensions are available from GraphicsConfiguration and GraphicsDevice . 2)   java.awt.Robot :- This class is used to generate native system input events for the purposes of test automation, self-running demos, and other applications where control of the mouse and keyboard is needed. The primary purpose of Robot is to facilitate automated testing of Java platform implementations. Using the class to generate input events differs from posting