aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes How To Stop Flicking JPanel Component? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How To Stop Flicking JPanel Component?" Watch "How To Stop Flicking JPanel Component?" New topic
Author

How To Stop Flicking JPanel Component?

Tom Finn
Greenhorn

Joined: Apr 15, 2012
Posts: 8
The code below flickers when I update. I've heard about double buffering but no idea how it works/how I would implement that.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
Go through the JPanel constructors; there is one with a boolean parameter. All you have to do is pass true to that.
I am not certain that is the correct solution, but double-buffering is the first thing I would try.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
It would seem to suggest that missing out the boolean flag will give it a double buffer, if you look at the JPanel ←link documentation. But it is still worth a rty.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
what is this doing in paintComponent?
x = new Converter();
Tom Finn
Greenhorn

Joined: Apr 15, 2012
Posts: 8
Good idea. I tried it but it didn't work though.
Tom Finn
Greenhorn

Joined: Apr 15, 2012
Posts: 8
what is this doing in paintComponent?
x = new Converter();

I just spotted that myself. (The program is quite large).

Removed it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How To Stop Flicking JPanel Component?
 
Similar Threads
MouseDragg
Crack showing between polygons
Add image to JPanel
A flatland puzzle
jpane with scrollpane is not displaying