public void addGroupedColumn(int columnIndex){
  int[][] newColGroups=getColumnGroups();
  if (newColGroups.length == 0) {
    newColGroups=new int[][]{{columnIndex}};
  }
 else {
    int lastGroupIndex=newColGroups.length - 1;
    int[] lastGroup=newColGroups[lastGroupIndex];
    int groupSize=lastGroup.length;
    int[] newLastGroup=new int[groupSize + 1];
    System.arraycopy(lastGroup,0,newLastGroup,0,groupSize);
    newLastGroup[groupSize]=columnIndex;
    newColGroups[lastGroupIndex]=newLastGroup;
  }
  setColumnGroups(newColGroups);
}

public void addGroupedColumn ( int columnIndex ) { int [ ] [ ] newColGroups = getColumnGroups ( ) ; if ( newColGroups . length == 0 ) { newColGroups = new int [ ] [ ] { { columnIndex } } ; } else { int lastGroupIndex = newColGroups . length - 1 ; int [ ] lastGroup = newColGroups [ lastGroupIndex ] ; int groupSize = lastGroup . length ; int [ ] newLastGroup = new int [ groupSize + 1 ] ; System . arraycopy ( lastGroup , 0 , newLastGroup , 0 , groupSize ) ; newLastGroup [ groupSize ] = columnIndex ; newColGroups [ lastGroupIndex ] = newLastGroup ; } setColumnGroups ( newColGroups ) ; }
adds the specified column index to the last column group . in case there are no groups , a new group will be created .
