pref[i] = cols[i].getPreferredWidth(); min[i] = cols[i].getMinWidth(); max[i] = cols[i].getMaxWidth(); PREF += pref[i]; MIN += min[i]; MAX += max[i]; }  for (int i = 0; i < cols.length; ++i) { int adj = 0; if (spill > 0) adj = (spill * (pref[i] - min[i])) / (PREF - MIN); else adj = (spill * (max[i] - pref[i])) / (MAX - PREF); cols[i].setWidth(pref[i] + adj);
cols[i].setWidth(cols[i].getWidth() + average);
  private void distributeSpill(TableColumn[] cols, int spill)  {    int MIN = 0;    int MAX = 0;    int PREF = 0;    int[] min = new int[cols.length];    int[] max = new int[cols.length];    int[] pref = new int[cols.length];    for (int i = 0; i < cols.length; ++i)      {        pref[i] = cols[i].getPreferredWidth();        min[i] = cols[i].getMinWidth();        max[i] = cols[i].getMaxWidth();        PREF += pref[i];        MIN += min[i];        MAX += max[i];      }    for (int i = 0; i < cols.length; ++i)      {        int adj = 0;        if (spill > 0)                    adj = (spill * (pref[i] - min[i])) / (PREF - MIN);        else          adj = (spill * (max[i] - pref[i])) / (MAX - PREF);        cols[i].setWidth(pref[i] + adj);              }      }