item.images = new Image [count + 1];
item.images = new Image [columnCount + 1];
void createItem (TreeColumn column, int index) {	if (hwndHeader == 0) createParent ();	int count = OS.SendMessage (hwndHeader, OS.HDM_GETITEMCOUNT, 0, 0);	if (!(0 <= index && index <= count)) error (SWT.ERROR_INVALID_RANGE);	if (count == columns.length) {		TreeColumn [] newColumns = new TreeColumn [columns.length + 4];		System.arraycopy (columns, 0, newColumns, 0, columns.length);		columns = newColumns;	}	for (int i=0; i<items.length; i++) {		TreeItem item = items [i];		if (item != null) {			String [] strings = item.strings;			if (strings != null) {				String [] temp = new String [count + 1];				System.arraycopy (strings, 0, temp, 0, index);				System.arraycopy (strings, index, temp, index + 1, count - index);				item.strings = temp;			}			Image [] images = item.images;			if (images != null) {				Image [] temp = new Image [count + 1];				System.arraycopy (images, 0, temp, 0, index);				System.arraycopy (images, index, temp, index + 1, count - index);				item.images = temp;			}			if (index == 0) {				if (count != 0) {					if (strings == null) {						item.strings = new String [count + 1];						item.strings [1] = item.text;					}					item.text = "";					if (images == null) {						item.images = new Image [count + 1];						item.images [1] = item.image;					}					item.image = null;				}			}			if (item.cellBackground != null) {				int [] cellBackground = item.cellBackground;				int [] temp = new int [count + 1];				System.arraycopy (cellBackground, 0, temp, 0, index);				System.arraycopy (cellBackground, index, temp, index + 1, count - index);				temp [index] = -1;				item.cellBackground = temp;			}			if (item.cellForeground != null) {				int [] cellForeground = item.cellForeground;				int [] temp = new int [count + 1];				System.arraycopy (cellForeground, 0, temp, 0, index);				System.arraycopy (cellForeground, index, temp, index + 1, count - index);				temp [index] = -1;				item.cellForeground = temp;			}			if (item.cellFont != null) {				int [] cellFont = item.cellFont;				int [] temp = new int [count + 1];				System.arraycopy (cellFont, 0, temp, 0, index);				System.arraycopy (cellFont, index, temp, index + 1, count- index);				temp [index] = -1;				item.cellFont = temp;			}		}	}	System.arraycopy (columns, index, columns, index + 1, count - index);	columns [index] = column;		/*	* Bug in Windows.  For some reason, when HDM_INSERTITEM	* is used to insert an item into a header without text,	* if is not possible to set the text at a later time.	* The fix is to insert the item with an empty string.	*/	int hHeap = OS.GetProcessHeap ();	int pszText = OS.HeapAlloc (hHeap, OS.HEAP_ZERO_MEMORY, TCHAR.sizeof);	HDITEM hdItem = new HDITEM ();	hdItem.mask = OS.HDI_TEXT | OS.HDI_FORMAT;	hdItem.pszText = pszText;	if ((column.style & SWT.LEFT) == SWT.LEFT) hdItem.fmt = OS.HDF_LEFT;	if ((column.style & SWT.CENTER) == SWT.CENTER) hdItem.fmt = OS.HDF_CENTER;	if ((column.style & SWT.RIGHT) == SWT.RIGHT) hdItem.fmt = OS.HDF_RIGHT;	OS.SendMessage (hwndHeader, OS.HDM_INSERTITEM, index, hdItem);	if (pszText != 0) OS.HeapFree (hHeap, 0, pszText);		/* Update the scroll bars */	int bits = OS.GetWindowLong (handle, OS.GWL_STYLE);	if  ((bits & OS.TVS_NOHSCROLL) == 0) {		bits |= OS.TVS_NOHSCROLL;		OS.SetWindowLong (handle, OS.GWL_STYLE, bits);	}	setScrollWidth ();	updateScrollBar ();		/* Redraw to hide the items when the first column is created */	if (count == 0 && OS.SendMessage (handle, OS.TVM_GETCOUNT, 0, 0) != 0) {		OS.InvalidateRect (handle, null, true);	}}