code: protected void handleAnchorActivated(HyperlinkEvent e, String anchor) {
          ((JTextPane)e.getSource()).scrollToReference(anchor);
      }
docs: Called when the user clicks on an anchor e.g. <br>
  &lt;a href=&quot;#top&quot;&gt;Go to Top&lt;/a&gt;.
  <p>
  This default implementation will scroll the source pane so that the anchor
  target becomes visible.