@Override
        public void tableChanged(TableModelEvent e) {
            // JTable's implementation doesn't remove the cell editor on table
            // model change, which may result in runtime expections.
            if (table.isEditing()) {
                table.removeEditor();
            }
            removeAllRealCells(table);
            if (isAutoFitRowHeights()) {
                if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
                    fitAllRowHeights(table);
                } else {
                    for (int row = e.getFirstRow(); row <= e.getLastRow(); row++) {
                        fitRowHeight(table, row);
                    }
                }
            }
        }