Buggy code:
void destroyItem ( TableItem item ) { } void destroyScrollBar ( ScrollBar bar ) { } int drawItemProc ( int browser , int id , int property , int itemState , int theRect , int gdDepth , int colorDevice ) { } void enableWidget ( boolean enabled ) { } void fixScrollBar ( ) { } void fixSelection ( int index , boolean add ) { } String [ ] getAxAttributes ( ) { } public int getBorderWidth ( ) { } int getCheckColumnWidth ( ) { } public Rectangle getClientArea ( ) { } public TableColumn getColumn ( int index ) { } public int getColumnCount ( ) { } public int [ ] getColumnOrder ( ) { } public TableColumn [ ] getColumns ( ) { } int getGap ( ) { } public int getGridLineWidth ( ) { } public int getHeaderHeight ( ) { } public boolean getHeaderVisible ( ) { } int getId ( int index ) { } int getIndex ( int id ) { } int getInsetWidth ( ) { } public TableItem getItem ( int index ) { } public TableItem getItem ( Point point ) { } public int getItemCount ( ) { } public int getItemHeight ( ) { } public TableItem [ ] getItems ( ) { } public boolean getLinesVisible ( ) { } public TableItem [ ] getSelection ( ) { } public int getSelectionCount ( ) { } public int getSelectionIndex ( ) { } public int [ ] getSelectionIndices ( ) { } public TableColumn getSortColumn ( ) { } public int getSortDirection ( ) { } public int getTopIndex ( ) { } int helpProc ( int inControl , int inGlobalMouse , int inRequest , int outContentProvided , int ioHelpContent ) { } int hitTestProc ( int browser , int id , int property , int theRect , int mouseRect ) { } void hookEvents ( ) { } public int indexOf ( TableColumn column ) { } public int indexOf ( TableItem item ) { } public boolean isSelected ( int index ) { } int itemDataProc ( int browser , int id , int property , int itemData , int setValue ) { } int itemNotificationProc ( int browser , int id , int message ) { } int kEventAccessibleGetNamedAttribute ( int nextHandler , int theEvent , int userData ) { } int kEventMouseDown ( int nextHandler , int theEvent , int userData ) { } int kEventControlGetClickActivation ( int nextHandler , int theEvent , int userData ) { } int kEventControlSetCursor ( int nextHandler , int theEvent , int userData ) { } int kEventUnicodeKeyPressed ( int nextHandler , int theEvent , int userData ) { } void releaseChildren ( boolean destroy ) { } void releaseWidget ( ) { } public void remove ( int index ) { } public void remove ( int start , int end ) { } public void remove ( int [ ] indices ) { } public void removeAll ( ) { } public void removeSelectionListener ( SelectionListener listener ) { } void resetVisibleRegion ( int control ) { } public void select ( int index ) { } public void select ( int start , int end ) { } public void select ( int [ ] indices ) { } void selectIndices ( int [ ] indices , int count , boolean clear ) { } void select ( int [ ] ids , int count , boolean clear ) { } public void selectAll ( ) { } void setBackground ( float [ ] color ) { } int setBounds ( int x , int y , int width , int height , boolean move , boolean resize , boolean events ) { } public void setColumnOrder ( int [ ] order ) { } void setFontStyle ( Font font ) { } public void setHeaderVisible ( boolean show ) { } public void setItemCount ( int count ) { } void setItemHeight ( int itemHeight ) { } void setItemHeight ( Image image ) { } public void setLinesVisible ( boolean show ) { } public void setRedraw ( boolean redraw ) { } boolean setScrollBarVisible ( ScrollBar bar , boolean visible ) { } boolean setScrollWidth ( TableItem item ) { } boolean setScrollWidth ( TableItem [ ] items , boolean set ) { } public void setSelection ( int index ) { } void setSelection ( int index , boolean notify ) { } public void setSelection ( int start , int end ) { } public void setSelection ( int [ ] indices ) { } public void setSelection ( TableItem item ) { } public void setSelection ( TableItem [ ] items ) { } public void setSortColumn ( TableColumn column ) { } public void setSortDirection ( int direction ) { } void setTableEmpty ( ) { } public void setTopIndex ( int index ) { checkWidget ( ) ; checkItems ( false ) ; int itemHeight = getItemHeight ( ) ; int [ ] top = new int [ 1 ] ; int [ ] left = new int [ 1 ] ; OS . GetDataBrowserScrollPosition ( handle , top , left ) ; <START_BUG> top [ 0 ] = Math . max ( 0 , Math . min ( ( ( itemHeight * ( itemCount ) ) - ( getClientArea ( ) . height ) ) , ( index * itemHeight ) ) ) ; <END_BUG> OS . SetDataBrowserScrollPosition ( handle , top [ 0 ] , left [ 0 ] ) ; } public void showColumn ( TableColumn column ) { } void showIndex ( int index ) { } public void showItem ( TableItem item ) { } public void showSelection ( ) { } int trackingProc ( int browser , int id , int property , int theRect , int startPt , int modifiers ) { } }

Fix:
top [ 0 ] = Math . max ( 0 , Math . min ( ( ( ( itemHeight * ( itemCount ) ) + ( getHeaderHeight ( ) ) ) - ( getClientArea ( ) . height ) ) , ( index * itemHeight ) ) ) ;