Reputation: 386
The method tableChanged(TableModelEvent e)
of TableModelListener
is getting called whenever data is loaded into table from a CSV file. I don't want this to happen.
I want tableChanged(TableModelEvent e)
of TableModelListener
to be called only when table rows are added or when some cell data is updated manually.
Can Somebody tell me how this can be achieved?
Thanks in Advance!
Upvotes: 0
Views: 716
Reputation: 205865
One approach is to create a new TableModel
, to which no JTable
is listening. Update the table using setModel()
, which will generate a single TableModelEvent
. A minimal complete example is seen here.
Alternatively, remove and restore the problematic TableModelListener
.
Upvotes: 3