Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Thread PaintComponent  RSS feed

 
hans teeuwen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the method PaintComponent that I want to invoke every second, to update my drawn image.

When I put repaint() in my run method it doesn't invoke the paintComponent(). The run method is being executed but it doesn't call the paintComponent();



I've read some things about a eventlistener that I should use. Could someone enlighten me?
 
Rob Spoor
Sheriff
Posts: 21089
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"hans teeuwen", I have warned you about your name before. Please change it to match our naming policy. That means no fictitious names like your current one.

Read Concurrency in Swing to see how threads and Swing should be combined. In this case, I suggest a javax.swing.Timer.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!