J
Jorge Castro
HI,
I would be gratefull for any suggestions that might clarify the following
Problem: can't add a JTable to the listener list of a subclass
of AbstractTableModel.
In my programme I instatiate a DataTable and pass it to a JTable
contructor,
dataModel = new DataTable();
JTable jt = new JTable(dataModel);
//following line may not be neccessary as
//the JTable constructor should do this!
dataModel.addTableModelListener(jt);
where,
public DataTable extends AbstractTableModel implements SomeOtherInterface;
My objective it to relay remote events to the listeners of my DataTable, ie
the JTable.
However, this does not seem to be working. While trying to trace the cause
of the problem, I inspected the list of registered listeners of the
DataTable in my programme (by examining the field "listenerList" of the
AbstractTableModel):
listenerList.toString();
System.out.println("Listeners in listenerList: "
+ listenerList.getListenerCount());
and, to my surprise, there are zero listeners!
Why is the JTable not been registered as a listener?
Jorge Castro
I would be gratefull for any suggestions that might clarify the following
Problem: can't add a JTable to the listener list of a subclass
of AbstractTableModel.
In my programme I instatiate a DataTable and pass it to a JTable
contructor,
dataModel = new DataTable();
JTable jt = new JTable(dataModel);
//following line may not be neccessary as
//the JTable constructor should do this!
dataModel.addTableModelListener(jt);
where,
public DataTable extends AbstractTableModel implements SomeOtherInterface;
My objective it to relay remote events to the listeners of my DataTable, ie
the JTable.
However, this does not seem to be working. While trying to trace the cause
of the problem, I inspected the list of registered listeners of the
DataTable in my programme (by examining the field "listenerList" of the
AbstractTableModel):
listenerList.toString();
System.out.println("Listeners in listenerList: "
+ listenerList.getListenerCount());
and, to my surprise, there are zero listeners!
Why is the JTable not been registered as a listener?
Jorge Castro