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

Image flickering in the JFrame  RSS feed

 
Mostafa M.shawky
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my application I get images from the user's desktop and use them by two methods
1.Get images and preview them in a JPanel of size 150X 150
2.Get images and preview them in a JFrame as full screen

Those methods are called simultaneously so the JFrame becomes over the JPanel and when I repaint the image in the JPanel it makes flicker in the JFrame

This code for repaint images




This code for paint



 
Nick Meverden
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend using Thread.sleep() over Object.wait() for starters. Object.wait() is ment to be in a while loop with checking status. Can you post some more code, enough for test case?
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!