problems refreshing GUI

From: t12be (t12be_at_hotmail.com)
Date: 03/28/04


Date: 28 Mar 2004 09:31:15 -0800

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?



Relevant Pages

  • Re: disable column header display
    ... placing a JTable on a JScrollPane: Table with headers. ... placing a JTable on a JPanel: ...
    (comp.lang.java.gui)
  • Re: JTable Resizing
    ... It's the JScrollPane you need to get to resize, ... You need to ensure that layout manager for the container in which you place ... University of Leicester, Leicester, LE1 7RH, UK ...
    (comp.lang.java.gui)
  • Swithcing between 2 JTables.
    ... I'm writing a swing application that has 2 JTables on seperate ... JScrollPane. ... When data in table 1 is edited I submit it to a database ...
    (comp.lang.java.programmer)
  • Re: Horizontally scrolling JTable
    ... crollbars when container width < JTable min width. ... JScrollPane scrollPane = new JScrollPane; ... Is it impossible to have horizontal scrolling AND headings? ...
    (comp.lang.java.gui)
  • Re: JTable Resizing
    ... > Does anyone know how to get a JTable to resize to fill its parent ... In my case I have a JScrollPane which holds a JPanel ... When I resize the application, ...
    (comp.lang.java.gui)