Possible Duplicate:
Is there a way to take a screenshot using Java and save it to some sort of image?
I want to capture the screen in a particular application or a particular window. I am thinking of doing it in Java. If Java is okay for this purpose, then which API/Classes can I use ?