Buggy code:
childGroup . setLayout ( new GridLayout ( ) ) ; childGroup . setLayoutData ( new GridData ( SWT . FILL , SWT . FILL , true , true , 2 , 1 ) ) ; ToolBar toolBar = new ToolBar ( childGroup , SWT . FLAT ) ; toolBar . setLayoutData ( new GridData ( SWT . CENTER , SWT . CENTER , false , false ) ) ; add = new ToolItem ( toolBar , SWT . DROP_DOWN ) ; add . setText ( LayoutExample . getResourceString ( "Add" ) ) ; new ToolItem ( toolBar , SWT . SEPARATOR ) ; delete = new ToolItem ( toolBar , SWT . PUSH ) ; delete . setText ( LayoutExample . getResourceString ( "Delete" ) ) ; delete . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { resetEditors ( ) ; int [ ] selected = table . getSelectionIndices ( ) ; table . remove ( selected ) ; for ( int i = 0 ; i < ( table . getItemCount ( ) ) ; i ++ ) { TableItem item = table . getItem ( i ) ; item . setText ( 0 , item . getText ( 0 ) ) ; } refreshLayoutComposite ( ) ; layoutComposite . layout ( true ) ; layoutGroup . layout ( true ) ; } } ) ; new ToolItem ( toolBar , SWT . SEPARATOR ) ; clear = new ToolItem ( toolBar , SWT . PUSH ) ; clear . setText ( LayoutExample . getResourceString ( "Clear" ) ) ; clear . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { resetEditors ( ) ; children = layoutComposite . getChildren ( ) ; for ( int i = 0 ; i < ( children . length ) ; i ++ ) { children [ i ] . dispose ( ) ; } table . removeAll ( ) ; data . clear ( ) ; children = new Control [ 0 ] ; layoutGroup . layout ( true ) ; } } ) ; toolBar . pack ( ) ; new ToolItem ( toolBar , SWT . SEPARATOR ) ; code = new ToolItem ( toolBar , SWT . PUSH ) ; code . setText ( LayoutExample . getResourceString ( "Generate_Code" ) ) ; code . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { final Shell shell = new Shell ( ) ; shell . setText ( LayoutExample . getResourceString ( "Generated_Code" ) ) ; shell . setLayout ( new FillLayout ( ) ) ; final Text text = new Text ( shell , ( ( ( ( SWT . BORDER ) | ( SWT . MULTI ) ) | ( SWT . V_SCROLL ) ) | ( SWT . H_SCROLL ) ) ) ; String layoutCode = generateCode ( ) . toString ( ) ; if ( ( layoutCode . length ( ) ) == 0 ) return ; text . setText ( layoutCode ) ; Menu bar = new Menu ( shell , SWT . BAR ) ; shell . setMenuBar ( bar ) ; MenuItem editItem = new MenuItem ( bar , SWT . CASCADE ) ; editItem . setText ( LayoutExample . getResourceString ( "Edit" ) ) ; Menu menu = new Menu ( bar ) ; MenuItem select = new MenuItem ( menu , SWT . PUSH ) ; select . setText ( LayoutExample . getResourceString ( "Select_All" ) ) ; select . setAccelerator ( ( ( SWT . MOD1 ) + 'A' ) ) ; select . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { text . selectAll ( ) ; } } ) ; MenuItem copy = new MenuItem ( menu , SWT . PUSH ) ; copy . setText ( LayoutExample . getResourceString ( "Copy" ) ) ; copy . setAccelerator ( ( ( SWT . MOD1 ) + 'C' ) ) ; copy . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { text . copy ( ) ; } } ) ; MenuItem exit = new MenuItem ( menu , SWT . PUSH ) ; exit . setText ( LayoutExample . getResourceString ( "Exit" ) ) ; exit . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { shell . close ( ) ; } } ) ; editItem . setMenu ( menu ) ; shell . pack ( ) ; <START_BUG> shell . setSize ( 400 , 500 ) ; <END_BUG> shell . open ( ) ; while ( ! ( shell . isDisposed ( ) ) ) if ( ! ( display . readAndDispatch ( ) ) ) display . sleep ( ) ; } } ) ; createChildWidgets ( ) ; } void createChildWidgets ( ) { } void createComboEditor ( CCombo combo , TableEditor comboEditor ) { } void createControlGroup ( ) { } void createControlWidgets ( ) { } void createLayout ( ) { } void createLayoutComposite ( ) { } void createLayoutGroup ( ) { } Composite createTabFolderPage ( TabFolder tabFolder ) { } int [ ] sashWeights ( ) { } void createTextEditor ( Text text , TableEditor textEditor , int column ) { } void disposeEditors ( ) { } StringBuffer generateCode ( ) { } boolean needsGraphics ( ) { } boolean needsCustom ( ) { } StringBuffer generateLayoutCode ( ) { } StringBuffer getChildCode ( Control control , int i ) { } String [ ] getLayoutDataFieldNames ( ) { } String getTabText ( ) { } void refreshLayoutComposite ( ) { } void resetEditors ( ) { } void resetEditors ( boolean tab ) { } void setLayoutData ( ) { } void setLayoutState ( ) { } }

Fix:
shell . setSize ( 500 , 600 ) ;