if ((event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW)) && autoCreateColumnsFromModel) { rowHeights = null; if (getAutoCreateColumnsFromModel()) createDefaultColumnsFromModel(); resizeAndRepaint(); return; }     if (event == null || event.getType() == TableModelEvent.INSERT) {  if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.insertIndexInterval(first, last - first + 1, true); if (rowHeights != null) rowHeights.insertEntries(first, last - first + 1, rowHeight); } revalidate(); } if (event == null || event.getType() == TableModelEvent.DELETE) {  if (event != null) { int first = event.getFirstRow(); if (first < 0) first = 0; int last = event.getLastRow(); if (last < 0) last = getRowCount() - 1; selectionModel.removeIndexInterval(first, last); if (rowHeights != null) rowHeights.removeEntries(first, last - first + 1); } if (dataModel.getRowCount() == 0) clearSelection(); revalidate(); } repaint();
if (event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW)) handleCompleteChange(event); else if (event.getType() == TableModelEvent.INSERT) handleInsert(event); else if (event.getType() == TableModelEvent.DELETE) handleDelete(event); else handleUpdate(event);
  public void tableChanged (TableModelEvent event)  {    // update the column model from the table model if the structure has    // changed and the flag autoCreateColumnsFromModel is set    if ((event == null || (event.getFirstRow() == TableModelEvent.HEADER_ROW))        && autoCreateColumnsFromModel)      {        rowHeights = null;        if (getAutoCreateColumnsFromModel())        createDefaultColumnsFromModel();        resizeAndRepaint();        return;      }    // If the structure changes, we need to revalidate, since that might    // affect the size parameters of the JTable. Otherwise we only need    // to perform a repaint to update the view.    if (event == null || event.getType() == TableModelEvent.INSERT)      {        // Sync selection model with data model.        if (event != null)          {            int first = event.getFirstRow();            if (first < 0)              first = 0;            int last = event.getLastRow();            if (last < 0)              last = getRowCount() - 1;            selectionModel.insertIndexInterval(first, last - first + 1, true);            if (rowHeights != null)              rowHeights.insertEntries(first, last - first + 1, rowHeight);          }      revalidate();      }    if (event == null || event.getType() == TableModelEvent.DELETE)      {        // Sync selection model with data model.        if (event != null)          {            int first = event.getFirstRow();            if (first < 0)              first = 0;            int last = event.getLastRow();            if (last < 0)              last = getRowCount() - 1;            selectionModel.removeIndexInterval(first, last);            if (rowHeights != null)              rowHeights.removeEntries(first, last - first + 1);          }        if (dataModel.getRowCount() == 0)          clearSelection();        revalidate();      }    repaint();  }