Buggy code:
public void clear ( int index ) { } public void clear ( int start , int end ) { } public void clear ( int [ ] indices ) { } public void clearAll ( ) { } int computeColumnIntersect ( int x , int startColumn ) { } public Point computeSize ( int wHint , int hHint , boolean changed ) { } void createItem ( TableColumn column , int index ) { } void createItem ( TableItem item ) { } public void deselect ( int index ) { } public void deselect ( int start , int end ) { } public void deselect ( int [ ] indices ) { } public void deselectAll ( ) { } void destroyItem ( TableColumn column ) { } void destroyItem ( TableItem item ) { } int getCellPadding ( ) { } Image getCheckmarkImage ( ) { } public Control [ ] getChildren ( ) { } public TableColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TableColumn [ ] getColumns ( ) { } Image getGrayUncheckedImage ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } int getHeaderPadding ( ) { } public boolean getHeaderVisible ( ) { } public TableItem getItem ( int index ) { } public TableItem getItem ( Point point ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public TableItem [ ] getItems ( ) { } int getItemY ( TableItem item ) { } public boolean getLinesVisible ( ) { } TableColumn [ ] getOrderedColumns ( ) { } public TableItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } int getSelectionIndex ( TableItem item ) { } public int [ ] getSelectionIndices ( ) { } public int getTopIndex ( ) { } Image getUncheckedImage ( ) { } void handleEvents ( Event event ) { } void headerOnMouseDoubleClick ( Event event ) { } void headerOnMouseDown ( Event event ) { } void headerOnMouseExit ( ) { } void headerOnMouseMove ( Event event ) { } void headerOnMouseUp ( Event event ) { } void headerOnPaint ( Event event ) { } void headerPaintHShadows ( GC gc , int x , int y , int width , int height ) { } void headerPaintVShadows ( GC gc , int x , int y , int width , int height ) { } public int indexOf ( TableColumn column ) { } public int indexOf ( TableItem item ) { } static void initImages ( final Display display ) { } public boolean isSelected ( int index ) { } void onArrowDown ( int stateMask ) { } void onArrowLeft ( int stateMask ) { } void onArrowRight ( int stateMask ) { } void onArrowUp ( int stateMask ) { } void onCR ( ) { } void onDispose ( ) { } void onEnd ( int stateMask ) { } void onFocusIn ( ) { } void onFocusOut ( ) { } void onHome ( int stateMask ) { } void onKeyDown ( Event event ) { } void onMouseDoubleClick ( Event event ) { } void onMouseDown ( Event event ) { if ( ! ( isFocusControl ( ) ) ) <START_BUG> setFocus ( ) ; <END_BUG> int index = ( ( ( event . y ) - ( getHeaderHeight ( ) ) ) // ( itemHeight ) ) + ( topIndex ) ; if ( ! ( ( 0 <= index ) && ( index < ( itemsCount ) ) ) ) return ; TableItem selectedItem = items [ index ] ; if ( ( ( ( style ) & ( SWT . CHECK ) ) != 0 ) && ( selectedItem . getCheckboxBounds ( ) . contains ( event . x , event . y ) ) ) { if ( ( event . button ) != 1 ) return ; selectedItem . setChecked ( ( ! ( selectedItem . checked ) ) ) ; Event newEvent = new Event ( ) ; newEvent . item = selectedItem ; newEvent . detail = SWT . CHECK ; postEvent ( Selection , newEvent ) ; return ; } if ( ! ( selectedItem . getHitBounds ( ) . contains ( event . x , event . y ) ) ) return ; if ( ( ( ( event . stateMask ) & ( SWT . SHIFT ) ) == 0 ) && ( ( event . keyCode ) != ( SWT . SHIFT ) ) ) anchorItem = null ; if ( ( ( style ) & ( SWT . SINGLE ) ) != 0 ) { if ( ! ( selectedItem . isSelected ( ) ) ) { if ( ( event . button ) == 1 ) { selectItem ( selectedItem , false ) ; setFocusItem ( selectedItem , true ) ; redrawItem ( selectedItem . index , true ) ; Event newEvent = new Event ( ) ; newEvent . item = selectedItem ; postEvent ( Selection , newEvent ) ; return ; } if ( ( ( event . stateMask ) & ( ( SWT . CTRL ) | ( SWT . SHIFT ) ) ) == 0 ) { selectItem ( selectedItem , false ) ; setFocusItem ( selectedItem , true ) ; redrawItem ( selectedItem . index , true ) ; Event newEvent = new Event ( ) ; newEvent . item = selectedItem ; postEvent ( Selection , newEvent ) ; return ; } } if ( ( event . button ) == 1 ) { Event newEvent = new Event ( ) ; newEvent . item = selectedItem ; postEvent ( Selection , newEvent ) ;

Fix:
forceFocus ( ) ;