I have a transparent jframe that has scrolling text on it, and I need to capture just the jframe and not whats behind it. At first, java.awt.Robot looked promising, but it doesn't capture only the graphics context of the jframe. Maybe somebody knows a portion of the API that could help with this...
Asked
Active
Viewed 112 times
1 Answers
5
You can
- Create a BufferedImage with the JFrame's size
- Call the JFrame's print() method with the BufferedImage's graphics
Code:
BufferedImage image = new BufferedImage(frame.getWidth(), frame.getHeight(), BufferedImage.TYPE_INT_RGB);
frame.print(image.getGraphics());

sina72
- 4,931
- 3
- 35
- 36
-
Code included; pls consider accepting – sina72 Jun 25 '14 at 13:01