Forums Register Login

I update database but how to refresh JTable

+Pie Number of slices to send: Send
I am using AbstractTableModel
I update the database it works find but I have to manually do another search to see the new database available seats.
I try using model.fireTableDataChanged();
I need to refresh the Jtable manually when I book, but I would like it to do it asap when I book
help please
Thanks Lisa
+Pie Number of slices to send: Send
The assignment doesn't require for the clients view of the data to be in sync with the database.
If you want to update a row on your table, After you have updated the object collection in your abstract table model, call one of the following:
fireTableDataChanged();
fireTableRowsUpdated( index, index );
The sencond one should be better and more efficient if you'd like to update a single row only...
Hope this helps!!!
Benjam�n

[This message has been edited by Benjam�n Amodio (edited May 09, 2001).]
[This message has been edited by Benjam�n Amodio (edited May 09, 2001).]
+Pie Number of slices to send: Send
I feel it is better to do a new search whenever you you need to display records since other user may have booked on the database. I assume you lock the database while you do the up-dating only.
If you just update you user interface without get information from the database, the display may not be a real presentation of the database. The information is not upto-date.
Therefore it makes more sense to do a new search everytime of the display.
Please Comment.
Ruilin
+Pie Number of slices to send: Send
I have to agree it makes alot of sense because the info can be deceptive to other onlookers if I just refresh the GUI good Point
Lisa
Always! Wait. Never. Shut up. Look at this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 868 times.
Similar Threads
JTable question
problem displaying jtable
JTable
JTable
question about my JTable
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 14:18:27.