code: private void drawAttributedString(Graphics2D g, int x, int y, String text)
      {
          if (!ctx.getTextDecoration().isEmpty()) 
          {
              AttributedString as = new AttributedString(text);
              as.addAttribute(TextAttribute.FONT, ctx.getFont());
              if (ctx.getTextDecoration().contains(CSSProperty.TextDecoration.UNDERLINE))
                  as.addAttribute(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
              if (ctx.getTextDecoration().contains(CSSProperty.TextDecoration.LINE_THROUGH))
                  as.addAttribute(TextAttribute.STRIKETHROUGH, TextAttribute.STRIKETHROUGH_ON);
              g.drawString(as.getIterator(), x, y + getBaselineOffset());
          } 
          else
              g.drawString(text, x, y + getBaselineOffset());
      }
docs: Draws a single string with eventual attributes based on the current visual context.