Hi.
I'd like to detect when the value of a cell changes, hopefully
-without- adding listeners to each and every cell. I don't care what
the value is or which cell has changed, just the fact that a change
took place.
Any clues? I tried adding a TableModelListener but that didn't notify
me about the data changes.
Cheers,
Ian
> Hi.
>
[quoted text clipped - 7 lines]
> Cheers,
> Ian
Changes go to TableModel setValueAt(Object value, int rowIndex, int
columnIndex)
If you have our own model then it will be very simple for you.
If not - you may need to have it.
See example in DefaultTableModel::setValueAt(Object, int, int)
Ian McCall - 21 Oct 2005 15:48 GMT
>> Any clues? I tried adding a TableModelListener but that didn't notify
>> me about the data changes.
[quoted text clipped - 4 lines]
> Changes go to TableModel setValueAt(Object value, int rowIndex, int
> columnIndex)
Thanks - problem sorted. setValueAt() had been overridden in the
AbstractTableModel which was fine, but unbeknown to me had -also- been
overridden in the particular instance of JTable. The JTable version
wasn't firing any events, so the model was never notified properly.
Take out the overridden JTable method and things propagate as expected
to the TableModel.
Cheers,
Ian