protected void paintText(final Graphics g,final JComponent c,final Rectangle localTextRect,final String text){
  final Graphics2D g2d=g instanceof Graphics2D ? (Graphics2D)g : null;
  final AbstractButton b=(AbstractButton)c;
  final ButtonModel model=b.getModel();
  final FontMetrics fm=g.getFontMetrics();
  final int mnemonicIndex=AquaMnemonicHandler.isMnemonicHidden() ? -1 : b.getDisplayedMnemonicIndex();
  if (model.isEnabled()) {
    g.setColor(b.getForeground());
  }
 else {
    g.setColor(defaultDisabledTextColor);
  }
  SwingUtilities2.drawStringUnderlineCharAt(c,g,text,mnemonicIndex,localTextRect.x,localTextRect.y + fm.getAscent());
}

protected void paintText ( final Graphics g , final JComponent c , final Rectangle localTextRect , final String text ) { final Graphics2D g2d = g instanceof Graphics2D ? ( Graphics2D ) g : null ; final AbstractButton b = ( AbstractButton ) c ; final ButtonModel model = b . getModel ( ) ; final FontMetrics fm = g . getFontMetrics ( ) ; final int mnemonicIndex = AquaMnemonicHandler . isMnemonicHidden ( ) ? - 1 : b . getDisplayedMnemonicIndex ( ) ; if ( model . isEnabled ( ) ) { g . setColor ( b . getForeground ( ) ) ; } else { g . setColor ( defaultDisabledTextColor ) ; } SwingUtilities2 . drawStringUnderlineCharAt ( c , g , text , mnemonicIndex , localTextRect . x , localTextRect . y + fm . getAscent ( ) ) ; }
as of java 2 platform v 1 . 4 this method should not be used or overriden . use the painttext method which takes the abstractbutton argument .
