• Post Reply Bookmark Topic Watch Topic
  • New Topic

graphics.copyArea()..why would I use an iteration?  RSS feed

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've figured out a pretty simple optimization, after asking "why do I need this iteration":



Here's a (dumb) before and after: screendump

1. Am I dropping something out?
2. Comments?


 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know next-to-nothing about Images, but I do know you are missing something, yes.

Always start your paintComponent method with this lineAnd paintComponent should have protected access, not public. Beware of confusion with paintComponents; I think you have chosen the correct method.

We usually discuss this sort of thing on the Swing forum. Moving thread.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!