public static void drawStringUnderlineCharAt(JComponent c, Graphics g, String text, int underlinedIndex, int x, int y) {
        Graphics2D g2D = (Graphics2D) g;
        Object savedRenderingHint = null;
        if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) {
            savedRenderingHint = g2D.getRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING);
            g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, AbstractLookAndFeel.getTheme().getTextAntiAliasingHint());
        }
        if (getJavaVersion() >= 1.6) {
            try {
                Class swingUtilities2Class = Class.forName("sun.swing.SwingUtilities2");
                Class classParams[] = {JComponent.class, Graphics.class, String.class, Integer.TYPE, Integer.TYPE, Integer.TYPE};
                Method m = swingUtilities2Class.getMethod("drawStringUnderlineCharAt", classParams);
                Object methodParams[] = {c, g, text, new Integer(underlinedIndex), new Integer(x), new Integer(y)};
                m.invoke(null, methodParams);
            } catch (Exception ex) {
                BasicGraphicsUtils.drawString(g, text, underlinedIndex, x, y);
            }
        } else if (getJavaVersion() >= 1.4) {
            BasicGraphicsUtils.drawStringUnderlineCharAt(g, text, underlinedIndex, x, y);
        } else {
            BasicGraphicsUtils.drawString(g, text, underlinedIndex, x, y);
        }
        if (AbstractLookAndFeel.getTheme().isTextAntiAliasingOn()) {
            g2D.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, savedRenderingHint);
        }
    }