if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
final JEditorPane pane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
final HTMLFrameHyperlinkEvent evt = (HTMLFrameHyperlinkEvent) e;
final HTMLDocument doc = (HTMLDocument) pane.getDocument();
doc.processHTMLFrameHyperlinkEvent(evt);
} else {
try {
final String s = e.getURL().toExternalForm();
pane.setPage(s);
} catch (final Throwable t) {
try {
final Document doc = pane.getDocument();
final String content = doc.getText(0, doc
.getLength());
String searchString = " \n"
+ e.getDescription().substring(1);
int pos = content.indexOf(searchString);
if (pos == -1) {