Program: 51952
Project: 51952
Buggy source:
private void setupTable(){
  tableModel=new XulTableModel(this);
  table.setModel(this.tableModel);
  TableColumnModel columnModel=table.getColumnModel();
  for (int i=0; i < columns.getChildNodes().size(); i++) {
    if (i >= columnModel.getColumnCount()) {
      break;
    }
    SwingTreeCol child=(SwingTreeCol)columns.getChildNodes().get(i);
    TableColumn col=columnModel.getColumn(i);
    totalFlex+=child.getFlex();
    col.setHeaderValue(child.getLabel());
    col.setCellEditor(getCellEditor(child));
    col.setCellRenderer(getCellRenderer(child));
    initialized=true;
  }
  table.addComponentListener(new ComponentListener(){
    boolean loaded=false;
    public void componentHidden(    ComponentEvent arg0){
    }
    public void componentMoved(    ComponentEvent e){
    }
    public void componentShown(    ComponentEvent e){
    }
    public void componentResized(    ComponentEvent e){
      if (loaded) {
        return;
      }
      Rectangle size=table.getBounds();
      int newWidth=size.width;
      if (SwingTree.this.rows > -1) {
        int minHeight=table.getRowHeight() * rows;
        scrollpane.getViewport().setMinimumSize(new Dimension(scrollpane.getWidth(),minHeight - 100));
      }
      int newHeight=size.height;
      for (int i=0; i < table.getColumnCount(); i++) {
        int flex=SwingTree.this.columns.getColumn(table.getColumnModel().getColumn(i).getModelIndex()).getFlex();
        int newColWidth=(int)(newWidth * ((double)flex / totalFlex));
        int headerWidth=table.getColumnModel().getColumn(i).getPreferredWidth();
        int setWidth=newColWidth;
        table.getColumnModel().getColumn(i).setWidth(setWidth);
        table.getColumnModel().getColumn(i).setPreferredWidth(setWidth);
      }
      loaded=true;
    }
  }
);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      if (event.getValueIsAdjusting() == true) {
        return;
      }
      SwingTree.this.changeSupport.firePropertyChange("String_Node_Str",null,SwingTree.this.getSelectedRows());
    }
  }
);
  table.getTableHeader().setReorderingAllowed(this.isEnableColumnDrag());
}

Fixed version (ground truth):
private void setupTable(){
  tableModel=new XulTableModel(this);
  table.setModel(this.tableModel);
  TableColumnModel columnModel=table.getColumnModel();
  for (int i=0; i < columns.getChildNodes().size(); i++) {
    if (i >= columnModel.getColumnCount()) {
      break;
    }
    SwingTreeCol child=(SwingTreeCol)columns.getChildNodes().get(i);
    TableColumn col=columnModel.getColumn(i);
    totalFlex+=child.getFlex();
    col.setHeaderValue(child.getLabel());
    col.setCellEditor(getCellEditor(child));
    col.setCellRenderer(getCellRenderer(child));
    initialized=true;
  }
  table.addComponentListener(new ComponentListener(){
    boolean loaded=false;
    public void componentHidden(    ComponentEvent arg0){
    }
    public void componentMoved(    ComponentEvent e){
    }
    public void componentShown(    ComponentEvent e){
    }
    public void componentResized(    ComponentEvent e){
      if (loaded) {
        return;
      }
      Rectangle size=table.getBounds();
      int newWidth=size.width;
      if (SwingTree.this.rows > -1) {
        int minHeight=table.getRowHeight() * rows;
        scrollpane.getViewport().setMinimumSize(new Dimension(scrollpane.getWidth(),minHeight - 100));
      }
      int newHeight=size.height;
      for (int i=0; i < table.getColumnCount(); i++) {
        int flex=SwingTree.this.columns.getColumn(table.getColumnModel().getColumn(i).getModelIndex()).getFlex();
        int newColWidth=(int)(newWidth * ((double)flex / totalFlex));
        int headerWidth=table.getColumnModel().getColumn(i).getPreferredWidth();
        int setWidth=newColWidth;
        table.getColumnModel().getColumn(i).setWidth(setWidth);
        table.getColumnModel().getColumn(i).setPreferredWidth(setWidth);
      }
      loaded=true;
    }
  }
);
  table.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
    public void valueChanged(    ListSelectionEvent event){
      if (event.getValueIsAdjusting() == true) {
        return;
      }
      SwingTree.this.changeSupport.firePropertyChange("String_Node_Str",null,SwingTree.this.getSelectedRows());
    }
  }
);
  table.getTableHeader().setReorderingAllowed(this.isEnableColumnDrag());
  this.setDisabled(this.isDisabled());
}