distributeSpill(cols, spill);
distributeSpillResizing(cols, spill, resizingColumn);
  public void doLayout()  {    TableColumn resizingColumn = null;    int ncols = getColumnCount();    if (ncols < 1)      return;    int[] pref = new int[ncols];    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.getWidth();        pref[i] = p;        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);            distributeSpill(cols, spill);            break;          case AUTO_RESIZE_SUBSEQUENT_COLUMNS:            cols = new TableColumn[ncols];            for (int i = rCol; i < ncols; ++i)              cols[i] = columnModel.getColumn(i);            distributeSpill(cols, spill);            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();  }