repaint(); if (tableHeader!=null) tableHeader.repaint();
int leftBoundary = getLeftResizingBoundary(); int width = getWidth() - leftBoundary; repaint(leftBoundary, 0, width, getHeight()); if (tableHeader != null) tableHeader.repaint(leftBoundary, 0, width, tableHeader.getHeight());
  public void doLayout()  {    TableColumn resizingColumn = null;    int ncols = getColumnCount();    if (ncols < 1)      return;    int prefSum = 0;    int rCol = -1;    if (tableHeader != null)      resizingColumn = tableHeader.getResizingColumn();    for (int i = 0; i < ncols; ++i)      {        TableColumn col = columnModel.getColumn(i);        int p = col.getPreferredWidth();        prefSum += p;        if (resizingColumn == col)          rCol = i;      }    int spill = getWidth() - prefSum;    if (resizingColumn != null)      {        TableColumn col;        TableColumn [] cols;        switch (getAutoResizeMode())          {          case AUTO_RESIZE_LAST_COLUMN:            col = columnModel.getColumn(ncols-1);            col.setWidth(col.getPreferredWidth() + spill);            break;                      case AUTO_RESIZE_NEXT_COLUMN:            col = columnModel.getColumn(ncols-1);            col.setWidth(col.getPreferredWidth() + spill);            break;          case AUTO_RESIZE_ALL_COLUMNS:            cols = new TableColumn[ncols];            for (int i = 0; i < ncols; ++i)              cols[i] = columnModel.getColumn(i);            distributeSpillResizing(cols, spill, resizingColumn);            break;          case AUTO_RESIZE_SUBSEQUENT_COLUMNS:                        // Subtract the width of the non-resized columns from the spill.            int w = 0;            int wp = 0;            TableColumn column;            for (int i = 0; i < rCol; i++)              {                column = columnModel.getColumn(i);                w += column.getWidth();                wp+= column.getPreferredWidth();              }            // The number of columns right from the column being resized.            int n = ncols-rCol-1;            if (n>0)              {                // If there are any columns on the right sied to resize.                spill = (getWidth()-w) - (prefSum-wp);                int average = spill / n;                             // For all columns right from the column being resized:                for (int i = rCol+1; i < ncols; i++)                  {                    column = columnModel.getColumn(i);                    column.setWidth(column.getPreferredWidth() + average);                  }              }            resizingColumn.setWidth(resizingColumn.getPreferredWidth());            break;          case AUTO_RESIZE_OFF:          default:            int prefWidth = resizingColumn.getPreferredWidth();            resizingColumn.setWidth(prefWidth);          }      }    else      {        TableColumn [] cols = new TableColumn[ncols];        for (int i = 0; i < ncols; ++i)          cols[i] = columnModel.getColumn(i);        distributeSpill(cols, spill);              }        if (editorComp!=null)      moveToCellBeingEdited(editorComp);        // Repaint fixes the invalid view after the first keystroke if the cell    // editing is started immediately after the program start or cell    // resizing.     repaint();    if (tableHeader!=null)      tableHeader.repaint();  }