What I have is a Container with on it a JScrollPane to hold a JTable with
data provided by a database.
The problem is that when I get the result of a query and want my new
'JTable' to replace the old one, the old one is still behind the new one.
I tried several methods like:
repaint()
validate()
upate()
or removing all with 'removeAll()' and then placing the new JTable.
The only thing that almost worked is by placing it all on a JPanel and using
the methods 'removeAll()' 'add(JTable table)' and 'updateUI()' in that
order. It didn't show the old ones anymore but my JScrollPane isn't working
either and I had to give it a size myself.
Anyone who can work this out?
Christophe Vanfleteren - 28 Mar 2004 18:44 GMT
> What I have is a Container with on it a JScrollPane to hold a JTable with
> data provided by a database.
[quoted text clipped - 13 lines]
>
> Anyone who can work this out?
Why do you want to replace the JTable itself?
Can't you just change the data in the JTable's TableModel?
Also, you shouldn't mix AWT and Swing components. Use a JPanel instead of
the Container.

Signature
Kind regards,
Christophe Vanfleteren