Is it a good idea to add one row and call fireTableRowInserted() or adding all rows and then call fireTableDataChanged()?
Asked
Active
Viewed 524 times
1 Answers
3
If all you do is adding new rows, it's better to add all the rows, and call fireTableRowsInserted()
with the appropriate first and last rows. The view will have to handle only one event, and the event tells exactly what happens, which avoids refreshing the parts of the view that don't need to be refreshed.

JB Nizet
- 678,734
- 91
- 1,224
- 1,255
-
@D.G. by refreshing whole Model you probably lost all referencies to Custom Renderers and Editors – mKorbel Jul 09 '12 at 09:50
-
1@mKorbel no, that is structure changed, no data changed. And it's not probable, but certain for column specific renders/editors for tables where auto create columns from model is true (which is the default) – Walter Laan Jul 09 '12 at 12:55
-
I need to fire this after each row addition (and I'm adding a lot of them). Is there a way to avoid calculation of rows number each time? – Line Oct 03 '18 at 13:41