Unknown behaviour of interface TableModelListener
Hi,
I don抰 succeed to implement interface TableModelListener in an inherited class of JTable.
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import java.util.Vector;
import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
class ContrTabextends JTableimplements MouseListener, MouseMotionListener, TableModelListener{
private Object target=null;
public ContrTab(Vector rows, Vector colHead){
super (rows, colHead);
super.addMouseListener(this);
super.getModel().addTableModelListener(this);// this instead of super doesn't change anything
}
//public static void main(String[] args) {}
publicvoid mouseEntered(MouseEvent me){
target = me.getSource().getClass().getName();
System.out.println("mouse moves over " + target);
}
publicvoid mouseClicked(MouseEvent me){}
publicvoid mouseExited(MouseEvent me){}
publicvoid mousePressed(MouseEvent me){}
publicvoid mouseReleased(MouseEvent me){}
publicvoid mouseDragged(MouseEvent arg0){}
publicvoid mouseMoved(MouseEvent arg0){}
publicvoid tableChanged(TableModelEvent x){
System.out.println("reaction of tableChanged-method because of " + x);
}
}
1) What astonishes me first:
The compiler even doesn抰 complain when I omit the TableModelListener method
搕ableChanged?inside this class after adding this interface.
2) What happens adding the tableChanged method
The table (i.e. the instance of this inherited class) isn抰 constructed anymore by the calling class
Who抯 got answers to 1) and 2)
Thanks

