aspose file tools
The moose likes Swing / AWT / SWT and the fly likes Robot createScreenCapture() method not working correctly Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "Robot createScreenCapture() method not working correctly" Watch "Robot createScreenCapture() method not working correctly" New topic
Author

Robot createScreenCapture() method not working correctly

tim charles
Greenhorn

Joined: Oct 09, 2009
Posts: 13
Has anyone got an idea to why the following is capturing my entire screen rather than just what's inside the bounds of jpModel?




Regards
Tim
tim charles
Greenhorn

Joined: Oct 09, 2009
Posts: 13
*bump*
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

I think you'll have some more success in our GUI forum. Moving there.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
what was the result of

System.out.println(jpModel.getBounds());
tim charles
Greenhorn

Joined: Oct 09, 2009
Posts: 13
java.awt.Rectangle[x=0,y=0,width=991,height=536]

Which is far larger than the JPanel (jpModel) itself. I have no idea why its doing this
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8436

tim charles wrote:I have no idea why its doing this

Neither have we
Maybe you can try running your application in a debugger and see at what stage the bounds are getting set?


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Robot createScreenCapture() method not working correctly
 
Similar Threads
desktop ScreenShot
image height&width needed
Taking screenshot using java robot class not woring when pc is locked.
AWTException
how to save text as gif ?