Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / March 2004

Tip: Looking for answers? Try searching our database.

problems refreshing GUI

Thread view: 
t12be - 28 Mar 2004 18:31 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.