Buggy code:
) ; Button deselectAll = new Button ( dialog , SWT . PUSH ) ; deselectAll . setText ( ControlExample . getResourceString ( "Deselect_All" ) ) ; deselectAll . setLayoutData ( new GridData ( GridData . HORIZONTAL_ALIGN_FILL ) ) ; deselectAll . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { TableItem [ ] items = table . getItems ( ) ; for ( int i = 0 ; i < ( EVENT_INFO . length ) ; i ++ ) { items [ i ] . setChecked ( false ) ; } for ( int i = 0 ; i < ( customNames . length ) ; i ++ ) { items [ ( ( EVENT_INFO . length ) + i ) ] . setChecked ( false ) ; } } } ) ; final Button editEvent = new Button ( dialog , SWT . PUSH ) ; editEvent . setText ( ControlExample . getResourceString ( "Edit_Event" ) ) ; editEvent . setLayoutData ( new GridData ( ( ( GridData . HORIZONTAL_ALIGN_FILL ) | ( GridData . VERTICAL_ALIGN_BEGINNING ) ) ) ) ; editEvent . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { Point pt = editEvent . getLocation ( ) ; pt = e . display . map ( editEvent , null , pt ) ; int index = table . getSelectionIndex ( ) ; if ( ( ( getExampleWidgets ( ) . length ) > 0 ) && ( index != ( - 1 ) ) ) { createEditEventDialog ( dialog , pt . x , pt . y , index ) ; } } } ) ; editEvent . setEnabled ( false ) ; table . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { int fields = 0 ; int index = table . getSelectionIndex ( ) ; if ( ( index != ( - 1 ) ) && ( index < ( EVENT_INFO . length ) ) ) { fields = EVENT_INFO [ index ] . settableFields ; } editEvent . setEnabled ( ( fields != 0 ) ) ; } public void widgetDefaultSelected ( SelectionEvent e ) { if ( editEvent . getEnabled ( ) ) { Point pt = editEvent . getLocation ( ) ; pt = e . display . map ( editEvent , null , pt ) ; int index = table . getSelectionIndex ( ) ; if ( ( ( ( getExampleWidgets ( ) . length ) > 0 ) && ( index != ( - 1 ) ) ) && ( index < ( EVENT_INFO . length ) ) ) { createEditEventDialog ( dialog , pt . x , pt . y , index ) ; } } } } ) ; new Label ( dialog , SWT . NONE ) ; Button ok = new Button ( dialog , SWT . PUSH ) ; ok . setText ( ControlExample . getResourceString ( "OK" ) ) ; dialog . setDefaultButton ( ok ) ; ok . setLayoutData ( new GridData ( GridData . HORIZONTAL_ALIGN_FILL ) ) ; ok . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { TableItem [ ] items = table . getItems ( ) ; for ( int i = 0 ; i < ( EVENT_INFO . length ) ; i ++ ) { eventsFilter [ i ] = items [ i ] . getChecked ( ) ; } for ( int i = 0 ; i < ( customNames . length ) ; i ++ ) { eventsFilter [ ( ( EVENT_INFO . length ) + i ) ] = items [ ( ( EVENT_INFO . length ) + i ) ] . getChecked ( ) ; } dialog . dispose ( ) ; } } ) ; dialog . pack ( ) ; Rectangle bounds = dialog . getBounds ( ) ; Rectangle trim = dialog . computeTrim ( 0 , 0 , 0 , 0 ) ; Rectangle clientArea = display . getClientArea ( ) ; if ( ( bounds . height ) > ( clientArea . height ) ) { dialog . setSize ( bounds . width , ( ( clientArea . height ) - ( trim . height ) ) ) ; } <START_BUG> dialog . setLocation ( bounds . x , 0 ) ; <END_BUG> dialog . open ( ) ; while ( ! ( dialog . isDisposed ( ) ) ) { if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } } void createListenersGroup ( ) { } String [ ] getMethodNames ( ) { } Shell createSetGetDialog ( String [ ] methodNames ) { } void resetLabels ( ) { } String setMethodName ( String methodRoot ) { } String parameterInfo ( String methodRoot ) { } void getValue ( ) { } Class getReturnType ( String methodRoot ) { } void setValue ( ) { } Object [ ] parameterForType ( String typeName , String value , Widget widget ) { } void createOrientationGroup ( ) { } void createSizeGroup ( ) { } void createStyleGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } void setExampleWidgetPopupMenu ( ) { } protected void specialPopupMenuItems ( final Menu menu , final Event event ) { } void disposeExampleWidgets ( ) { } Image colorImage ( Color color ) { } Image fontImage ( Font font ) { } String [ ] getCustomEventNames ( ) { } int getDefaultStyle ( ) { } Widget [ ] getExampleWidgets ( ) { } Control [ ] getExampleControls ( ) { } Item [ ] getExampleWidgetItems ( ) { } String getShortTabText ( ) { } String getTabText ( ) { } void hookExampleWidgetListeners ( ) { } void hookCustomListener ( String eventName ) { } void hookListeners ( Widget widget ) { }

Fix:
dialog . setLocation ( bounds . x , clientArea . y ) ;