Two Laptop Bag
The moose likes Swing / AWT / SWT and the fly likes updating jTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "updating jTable" Watch "updating jTable" New topic

updating jTable

miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
i'v a jtable that displays database items; i'v inserts and updates too
i googled a lot but anyhow i cant manage it - how to have the table automaticaly updated
i tried several ways,like from input button action:

actually i'm using a solution that works in part, because it does refresh the jtable but conflitcs with the sorter class i'm using (from sun java tutorial):

i'm using this model:

how can i achieve this?
[ October 08, 2006: Message edited by: miguel lisboa ]

java amateur
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
after re-reading sun java tutorial on jTable, i added this to my code:

which is called when user pushes add button
inddeed the table refreshes, but overwrites last row
if i close and reenter my app, values are correct, but in fact this does not work
if i try adding one to the row count i get an error out of bounds...
dont knoow how to fix this
I agree. Here's the link:
subject: updating jTable
It's not a secret anymore!