code: public void paintText(SynthContext ss, Graphics g, String text, int x, int y, int mnemonicIndex) {
          if (text != null) {
              Graphics2D g2d = (Graphics2D) g.create();
  
              g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
              JComponent c = ss.getComponent();
  
              // SynthStyle style = ss.getStyle();
              FontMetrics fm = SwingUtilities2.getFontMetrics(c, g2d);
  
              y += fm.getAscent();
              SwingUtilities2.drawString(c, g2d, text, x, y);
  
              if (mnemonicIndex >= 0 && mnemonicIndex < text.length()) {
                  int underlineX = x + SwingUtilities2.stringWidth(c, fm, text.substring(0, mnemonicIndex));
                  int underlineY = y;
                  int underlineWidth = fm.charWidth(text.charAt(mnemonicIndex));
                  int underlineHeight = 1;
  
                  g2d.fillRect(underlineX, underlineY + fm.getDescent() - 1, underlineWidth, underlineHeight);
              }
          }
      }
docs: Paints text at the specified location. This will not attempt to render
  the text as html nor will it offset by the insets of the component.
  
  @param ss
  SynthContext
  @param g
  Graphics used to render string in.
  @param text
  Text to render
  @param x
  X location to draw text at.
  @param y
  Upper left corner to draw text at.
  @param mnemonicIndex
  Index to draw string at.