I'm trying out an idea I had which requires me to capture the contents of a java window/Frame, much like a screenshot but without the window and menubar, just the contents rendered in java, i.e. an exact image of what is visible in the java application at the moment.

I would also like the screenshot to be software rendered, I don't know if I'm using the correct term, but the captured image should not be different on others systems/computers.

Can i for example hijack a render buffer/display buffer or something and write that to in image?

Does anyone have any ideas?



5 Years
Discussion Span
Last Post by harinath_2007

Try this..Robot

Robot r=new Robot();
r.createScreenCapture(new Rectangle(your jframe co-ordinates as parameters));

You need to calculate the co-ordinates of your frame inorder to capture only the frame.

If you want to write the captured image to a image file , you can use ImageIO.write() method

Edited by harinath_2007: url edit..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.