code: static Map<Point, Object> addHighlights(JTextComponent textComponent,
          Iterable<? extends Point> appearances, Color color)
      {
          Highlighter.HighlightPainter painter =
              new DefaultHighlighter.DefaultHighlightPainter(color);
          Highlighter highlighter = textComponent.getHighlighter();
          Map<Point, Object> highlights = new LinkedHashMap<Point, Object>();
          for (Point appearance : appearances)
          {
              try
              {
                  Object highlight = highlighter.addHighlight(
                      appearance.x, appearance.y, painter);
                  highlights.put(appearance, highlight);
              }
              catch (BadLocationException e)
              {
                  // Should never happen
                  logger.severe(e.toString());
              }
          }
          return highlights;
      }
docs: Add the given highlights to the given text component.
  
  @param textComponent The text component
  @param appearances The appearances
  @param color The color
  @return The mapping from appearances to highlights