Win a copy of Kotlin in Action this week in the Kotlin forum!
  • 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
Marshal
Posts: 55715
163
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!