columnModel.getColumn(i).setHeaderValue(dataModel.getColumnName(i));
{ column = columnModel.getColumn(i); if (column.getHeaderValue()==null) column.setHeaderValue(dataModel.getColumnName(i)); }
  public void setColumnModel(TableColumnModel c)  {    if (c == null)      throw new IllegalArgumentException();    TableColumnModel tmp = columnModel;    if (tmp != null)      tmp.removeColumnModelListener(this);    if (c != null)      c.addColumnModelListener(this);    columnModel = c;    if (dataModel != null && columnModel != null)      {        int ncols = getColumnCount();        for (int i = 0; i < ncols; ++i)          columnModel.getColumn(i).setHeaderValue(dataModel.getColumnName(i));      }    // according to Sun's spec we also have to set the tableHeader's    // column model here    if (tableHeader != null)      tableHeader.setColumnModel(c);    revalidate();    repaint();  }