TableModelListener
and TableModelEvent
won't provide information about the JTable
that the model is associated with, as the model may be shared by multiple tables, in theory.
Getting the row is matter of getting the row from the event, which comes from the firstRow
and lastRow
properties. Once you can establish which table the model belongs to you, you can determine the view row by using JTable#convertRowIndexToView
To find the JTable
you have, at least, two basic solutions
You Could...
Ask each table, stored in each JTabbedPane
for their model and compare it with the model that generated the table model event
You Could...
Maintain some kind of look up between the TableModel
and the JTable
or JTabbedPane
, depending on what it's you are ultimately after
This could be achieved by using Map
of some kind, keyed to the TableModel