Buggy code:
public class TabItem extends Item { TabFolder parent ; int x ; int y ; int width ; int height = 0 ; String toolTipText ; Control control ; static final int LEFT_HORIZONTAL_MARGIN = 8 ; static final int RIGHT_HORIZONTAL_MARGIN = 2 ; static final int VERTICAL_MARGIN = 1 ; static final int ICON_MARGIN = 6 ; static final int SHADOW_WIDTH = 2 ; static final int DEFAULT_TEXT_WIDTH = 36 ; public TabItem ( TabFolder parent , int style ) { } public TabItem ( TabFolder parent , int style , int index ) { } protected void checkSubclass ( ) { } public void dispose ( ) { } void expand ( int left , int top , int right , int bottom ) { } Rectangle getBounds ( ) { } public Control getControl ( ) { } public TabFolder getParent ( ) { } public String getToolTipText ( ) { } boolean hasLocation ( ) { } private int imageHeight ( ) { } private int imageWidth ( ) { } void paint ( GC gc , boolean isSelected ) { gc . setForeground ( display . getSystemColor ( COLOR_WIDGET_HIGHLIGHT_SHADOW ) ) ; gc . drawLine ( x , ( ( ( y ) + ( height ) ) - 2 ) , x , ( ( y ) + 2 ) ) ; gc . drawLine ( x , ( ( y ) + 2 ) , ( ( x ) + 2 ) , y ) ; gc . drawLine ( ( ( x ) + 2 ) , y , ( ( ( x ) + ( width ) ) - 3 ) , y ) ; gc . setForeground ( display . getSystemColor ( COLOR_WIDGET_LIGHT_SHADOW ) ) ; gc . drawLine ( ( ( x ) + 1 ) , ( ( ( y ) + ( height ) ) - 2 ) , ( ( x ) + 1 ) , ( ( y ) + 2 ) ) ; gc . drawLine ( ( ( x ) + 2 ) , ( ( y ) + 1 ) , ( ( ( x ) + ( width ) ) - 3 ) , ( ( y ) + 1 ) ) ; gc . setForeground ( display . getSystemColor ( COLOR_WIDGET_FOREGROUND ) ) ; gc . drawLine ( ( ( ( x ) + ( width ) ) - 1 ) , ( ( y ) + 2 ) , ( ( ( x ) + ( width ) ) - 1 ) , ( ( ( y ) + ( height ) ) - 1 ) ) ; gc . drawLine ( ( ( ( x ) + ( width ) ) - 2 ) , ( ( y ) + 1 ) , ( ( ( x ) + ( width ) ) - 2 ) , ( ( y ) + 1 ) ) ; gc . setForeground ( display . getSystemColor ( COLOR_WIDGET_NORMAL_SHADOW ) ) ; gc . drawLine ( ( ( ( x ) + ( width ) ) - 2 ) , ( ( y ) + 2 ) , ( ( ( x ) + ( width ) ) - 2 ) , ( ( ( y ) + ( height ) ) - 1 ) ) ; if ( ( parent . isFocusControl ( ) ) && isSelected ) { gc . drawFocus ( ( ( x ) + 3 ) , ( ( y ) + 3 ) , ( ( width ) - 6 ) , ( ( height ) - 3 ) ) ; } gc . setForeground ( parent . getForeground ( ) ) ; int xDraw = ( x ) + ( TabItem . LEFT_HORIZONTAL_MARGIN ) ; int yCenter ; int decorationHeight = ( ( TabItem . SHADOW_WIDTH ) * 2 ) + ( ( TabItem . VERTICAL_MARGIN ) * 2 ) ; Image image = getImage ( ) ; Rectangle sourceBounds = null ; if ( image != null ) { sourceBounds = image . getBounds ( ) ; yCenter = ( ( ( y ) + ( TabItem . SHADOW_WIDTH ) ) + ( TabItem . VERTICAL_MARGIN ) ) + ( ( ( ( height ) - decorationHeight ) - ( imageHeight ( ) ) ) // 2 ) ; gc . drawImage ( image , sourceBounds . x , sourceBounds . y , sourceBounds . width , sourceBounds . height , xDraw , yCenter , sourceBounds . width , parent . getImageHeight ( ) ) ; } xDraw = xDraw + ( TabItem . ICON_MARGIN ) ; if ( sourceBounds != null ) { xDraw += sourceBounds . width ; } yCenter = ( ( ( y ) + ( TabItem . SHADOW_WIDTH ) ) + ( TabItem . VERTICAL_MARGIN ) ) + ( ( ( ( height ) - decorationHeight ) - ( textHeight ( gc ) ) ) // 2 ) ; <START_BUG> int flags = SWT . DRAW_MNEMONIC ; <END_BUG> gc . drawText ( getText ( ) , xDraw , yCenter , flags ) ; } int preferredHeight ( GC gc ) { } int preferredWidth ( GC gc ) { } public void setControl ( Control control ) { } public void setImage ( Image image ) { } public void setText ( String string ) { } public void setToolTipText ( String string ) { } private int textHeight ( GC gc ) { } private int textWidth ( GC gc ) { } }

Fix:
int flags = ( SWT . DRAW_MNEMONIC ) | ( SWT . DRAW_TRANSPARENT ) ;