int col = - 1;
int col = model.getColumnCount()-1;
    void endDragging(MouseEvent e)    {      header.setDraggedColumn(null);      // Return if the mouse have left the header area while pressed.      if (e == null)        {          header.repaint(draggingHeaderRect);          draggingHeaderRect = null;          return;  }      else        draggingHeaderRect = null;      TableColumnModel model = header.getColumnModel();      // Find where have we dragged the column.      int x = e.getX();      int p = 0;      int col = - 1;      int n = model.getColumnCount();      Scan: for (int i = 0; i < n; i++)        {          p += model.getColumn(i).getWidth();          if (p > x)            {              col = i;              break Scan;            }        }      if (col >= 0)        header.getTable().moveColumn(draggingColumnNumber, col);    }