• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTable and AbstractTableModel

 
David Jon
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I have created a JTable using a class that inherits from AbstractTableModel. What is really strange is that when I run the class that creates the top level conatainers everything seems ok, until I move the mouse over the table. Every time I move the mouse it generates *LOADS* of calls to the TableModels getRowCount method. Has anyone else come accross this? I am sure this is not normal behaviour as it is very inefficient.
Thanks,
DJ.
 
Tim Osten
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this
JTable table = new JTable() {
protected void processMouseMotionEvent(MouseEvent evt) {
switch (evt.getID()) {
case MouseEvent.MOUSE_MOVED:
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
break;
default:
super.processMouseMotionEvent(evt);
break;
}
}
};
Sorry about the format :-)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!