Swing's JEditorPane allows you to quickly and easily produce simple browsers or hyperlinked help facilities, but there's a hitch -- the mouse doesn't change when you're over a hyperlink. Swing expert Marc Loy shows you how to fix this minor annoyance with a small amount of code. In the process, he gives you the tools to start customizing the editor pane to do more for you than any browser or help system out there. (1,700 words)
Swing's JEditorPane allows you to quickly and easily produce simple browsers or hyperlinked help facilities, but there's a hitch -- the mouse doesn't change when you're over a hyperlink. Swing expert Marc Loy shows you how to fix this minor annoyance with a small amount of code. In the process, he gives you the tools to start customizing the editor pane to do more for you than any browser or help system out there. (1,700 words)
To display HTML in a JEditorPane, you would normally specify a URL that sets the document base of the HTMLDocument. However, if the HTML text is not stored in a file locally or on the Web, you cannot set the HTMLDocument document base. That becomes a problem when the IMG tag uses a relative path to specify the image location, but it can be overcome by modifying JEditorPane and its associated classes. (2,000 words)