Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Robot createScreenCapture() method not working correctly

 
tim charles
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*bump*
 
Rob Spoor
Sheriff
Pie
Posts: 20510
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you'll have some more success in our GUI forum. Moving there.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what was the result of

System.out.println(jpModel.getBounds());
 
tim charles
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic