question: public void paintText ( SynthContext ss , Graphics g , String text , Icon icon , int hAlign , int vAlign , int hTextPosition , int vTextPosition , int iconTextGap , int mnemonicIndex , int textOffset ) { if ( ( icon == null ) && ( text == null ) ) { return ; } Graphics2D g2d = ( Graphics2D ) g . create ( ) ; g2d . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; JComponent c = ss . getComponent ( ) ; FontMetrics fm = SwingUtilities2 . getFontMetrics ( c , g2d ) ; Insets insets = SeaGlassLookAndFeel . getPaintingInsets ( ss , paintInsets ) ; paintViewR . x = insets . left ; paintViewR . y = insets . top ; paintViewR . width = c . getWidth ( ) - ( insets . left + insets . right ) ; paintViewR . height = c . getHeight ( ) - ( insets . top + insets . bottom ) ; paintIconR . x = paintIconR . y = paintIconR . width = paintIconR . height = 0 ; paintTextR . x = paintTextR . y = paintTextR . width = paintTextR . height = 0 ; String clippedText = layoutText ( ss , fm , text , icon , hAlign , vAlign , hTextPosition , vTextPosition , paintViewR , paintIconR , paintTextR , iconTextGap ) ; if ( icon != null ) { Color color = g2d . getColor ( ) ; paintIconR . x += textOffset ; paintIconR . y += textOffset ; SeaGlassIcon . paintIcon ( icon , ss , g2d , paintIconR . x , paintIconR . y , paintIconR . width , paintIconR . height ) ; g2d . setColor ( color ) ; } if ( text != null ) { View v = ( View ) c . getClientProperty ( BasicHTML . propertyKey ) ; if ( v != null ) { v . paint ( g2d , paintTextR ) ; } else { paintTextR . x += textOffset ; paintTextR . y += textOffset ; paintText ( ss , g2d , clippedText , paintTextR , mnemonicIndex ) ; } } }
target:  Paints an icon and text. This will render the text as html, if necessary, and offset the location by the insets of the component.