Fickering on JTable / Double Buffering

J

Jason

I have an applet which basically consists of a big JTable.

However, every time just a single cell in the table is updated, the whole
table flickers when repaint is called.

How can I get rid of the flicker. I have tried using double buffering, but
that doesn't work or I am not doing it right. Is double buffering the way to
do and if so, how do you achieve this with a JTable

Thanks

J
 
A

Andrew Hobbs

Jason said:
I have an applet which basically consists of a big JTable.

However, every time just a single cell in the table is updated, the whole
table flickers when repaint is called.

How can I get rid of the flicker. I have tried using double buffering, but
that doesn't work or I am not doing it right. Is double buffering the way to
do and if so, how do you achieve this with a JTable

Swing components are double buffered by default. If you have code in there
that is trying to double buffer that may itself be causing problems. You
also shouldn't be calling repaint. You should be firing a cellUpdated call.
That way the renderer only needs to repaint the appropriate cells, and not
the complete screen.

Have you looked at the Sun tutorial on using JTables at

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html

Cheers

Andrew


--
********************************************************
Andrew Hobbs PhD

MetaSense Pty Ltd - www.metasense.com.au
Australia

61 8 9246 2026
metasens AntiSpam @iinet dot net dot au


*********************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top