Deuphil Kaufmann wrote:i have an application with which is distributed to many user sharing 1 common db. my concern is, is there any way to make updating jtables/tablemodels better instead of using threads and such,,,my updating is functioning well, but i want to make my jtable/tablemodel always up-to-date with the data without the user noticing any hangs or performance issues... i'm using abstrattablemodel as my basis for my tables, i i call a reload() method in which it re-populates the model's vector and set it again to the jtable, any suggestions? i've searched for some solutions they all point to same things. and also, data from the database is more than 100 records, minimum,,,, i'm pondering in using pagination instead, seems weird, but seems to be the best solution while limiting the data loaded, yet still updated. any directions suggestion are welcome...thanks!
Well you're probably going to have to use "threads and such," but you're doing something wrong if there are hangs or performance issues.
So your reload() method reloads every row and then calls JTable.setModel()?? I would recommend instead keeping the same model throughout, but push new values into it when appropriate and call AbstractTableModel's fireTableCellUpdated() or fireTableRowsUpdated() so the table can update itself.
Also you might want to use a more efficient Collection class than java.util.Vector.