if (event.getType() == TableModelEvent.INSERT)
if (event == null || event.getType() == TableModelEvent.INSERT)
  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.getFirstRow() ==TableModelEvent.HEADER_ROW)        && autoCreateColumnsFromModel)        createDefaultColumnsFromModel();    // 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.getType() == TableModelEvent.INSERT)      revalidate();    else if (event.getType() == TableModelEvent.DELETE)      {        if (dataModel.getRowCount() == 0)          clearSelection();        revalidate();      }    repaint();  }