Search code examples
javaswingtablemodel

Java Swing: implement TableModel or extend AbstractTableModel?


When should I rather implement TableModel and when should I extend AbstractTableModel?


Solution

  • AbstractTableModel has implementation for the handling of TableModelListeners, including the firing of TableModelEvents. If you want to handle that yourself, then there really is no reason to extend. Outside of that code, the other code doesnt add any benefit other than the stubbing out of methods declared in the interface.