Retarding the repainting of a JComponent

R

Richard B. Christ

I am working with a table (not the JTable but a fully customized
extension of
JComponent). With this table it is possible to have some rows selected
and to have column sorted(s) for instance. This table implementation
is per default embedded in a JScrollPane.
After having changed the whole model of the table, I would like to
retrieve the
previous state (defined by the position of the scrollbar, the selected
rows and the sorted column(s)) of the table. While doing this Java
does the things one after the other so that the user sees the whole
process (what is not very elegant):
- user gets a new table
- old selected rows gets selected
- old sorted columns get sorted
- scrollbar updates its state
I would like Java making all these updating steps before showing the
table. I would like Java retarding the repainting of the table until
the table has selected its previous selected rows, until the table has
sorted its previous sorted columns and so on. How can I achieve that?
Any help would be gracefully appreciated. Cheers,

richard
 
H

Harald Hein

Richard B. Christ said:
While doing this Java
does the things one after the other so that the user sees the whole
process (what is not very elegant):

No, it is not Java, it is you who does this by firing the corresponding
events. First do all your changes in the model, than fire one event
telling the JTable to update the display.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top