这很模糊,但由于某种原因,通知AbstractTableModel
是从后到先的,导致我的代码出现错误。我可以修复它,但我想知道是否有人知道为什么以这种方式完成通知?
public void fireTableChanged(TableModelEvent e) {
// Guaranteed to return a non-null array
Object[] listeners = listenerList.getListenerList();
// Process the listeners last to first, notifying
// those that are interested in this event
for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==TableModelListener.class) {
((TableModelListener)listeners[i+1]).tableChanged(e);
}
}
}