wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes improve speed for Jtable data showing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "improve speed for Jtable data showing" Watch "improve speed for Jtable data showing" New topic

improve speed for Jtable data showing

Yahya Elyasse
Ranch Hand

Joined: Jul 07, 2005
Posts: 510

I'm dynamically filling a JTable with data that is between 1000 and 2000.
i extended a DefaultTableModel in which i have a method that calls addRow() for each file added to JTable.
it seems that the addRow() method is slowing the process because it asks the table to repaint each time it is called.

I thought to completely eliminate the updating the table as a batch

I need help to write my own table model which internally keeps all the data as an array of File objects

i want to place all the data i need to add to table as a list of hash maps and write a table model that directly uses that list as the data set.

can someone show me some code for that ?

here is my current Table Model : (i suppose i need to change the addFile(File) method to make it addFile( File[]) and tell table to update after all File added not each time we call addRow())

thanks for helping
Don't get me started about those stupid light bulbs.
subject: improve speed for Jtable data showing
Similar Threads
Appending row to end of JTable
JTextfield data in JTable row
JTable Updating
AbstractTableModel how to read in header and row
JTable with inseting and autonumbering problem