aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes dynamic update of JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "dynamic update of JTable" Watch "dynamic update of JTable" New topic
Author

dynamic update of JTable

Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

so many searches in google about this topic . .
some examples are more far than my requirement.
but i cant conclude how to update my table's data . . .
please help . . .

every time i am creating a new model and setting to the table, and that is not updated in the view.
in some example revalidation() is used to update the gui . . . its not working for me.
and somone suggested me to update gui in separate thread, i have updated the scrollpane and table in separate thread . . . no use.
what to do to get updated result in table.


and again i have one more question in general . . . in my swing practice, validate(), invalidate(), revalidate() methods are not updating the gui.

am i thing in a wrong way when updating the gui ?
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
sanjeev charla wrote:so many searches in google about this topic . .
some examples are more far than my requirement.
but i cant conclude how to update my table's data . . .
please help . . .

There's only one place you really need to look, and that's the Sun Swing tutorial. It shows you how to do this and gives decent code examples.


every time i am creating a new model and setting to the table, and that is not updated in the view.

Then you're doing something wrong, since that should do it. I suggest you create a small compilable program that demonstrates that these steps don't work for you.


in some example revalidation() is used to update the gui . . . its not working for me.

Not needed to update a JTable.


and somone suggested me to update gui in separate thread, i have updated the scrollpane and table in separate thread . . . no use.

Without code, we have no idea where your error is.


and again i have one more question in general . . . in my swing practice, validate(), invalidate(), revalidate() methods are not updating the gui.

am i thing in a wrong way when updating the gui ?

Without seeing your code and knowing where your errors are, I don't know.
Sanjeev Charla
Ranch Hand

Joined: Apr 02, 2009
Posts: 90

thanks for the reply . . .
the first resource to me is the sun's tutorial always . . .
but this time , i cant conclude how to code to update table in application from that tutorial.
please suggest me an example if possible.
(each and every time a new data is displayed in the table. this is the only requirement.) thanks . . .
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2226
    
    8
every time i am creating a new model and setting to the table,


Then it should work.

You've been asked to post your SSCCE. We can't help you otherwise!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dynamic update of JTable