I am creating an HTML report within my application, and displaying the contents with the JEditorPane. I have put links within the HTML page to navigate to different parts of the same page; think summary at the top, and then detail sections lower down the same page. The links are meant to take you from areas on the summary to the specific detail sections. I have other links that are mean to return you to the top of the page.

I am finding that in my HyperlinkEventListener, the event.getURL() returns null, and event.getDescription() does return the href value of the link in the page. What I am having problems with is getting a valid URL that I can pass back to the JEditorPane to cause it to scroll down to detail section that matches the id within the Page that is currently being displayed.

It almost seems as if the JEditorPane doesn't know about a base directory for the page, as it is generated internally, and passed in as text to the JEditorPane.

Does anyone know how to get a valid URL for the situation I am working with?

Thanks.