A Jury Rigged Browser

JTextField and JTextArea let you set the font, size, and color, but only one font, size, and color.

JEditorPane supports styled text in plain text, RTF, and HTML formats.
With a few additional widgets and a little ingenuity, we could turn it into a primitive WordPad.
But we could never turn it into Microsoft Word.

Because JEditorPane renders HTML fairly well, we can use it as the basis of a primitive browser.
But we will never turn it into Netscape.



HelpBrowser
+ showDialogHelp(String)
+ showKahunaHelpPage()
+ showOperatorHelpPage(String)
+ showSSHelp(String, String)
JEditorPane
+ addHyperlinkListener(HyperlinkListener)
+ getEditorKit() : EditorKit
+ setEditorKit(EditorKit)
+ getContentType() : String
+ setContentType(String)
+ getPage() : URL
+ setPage(URL)
+ getText() : String
+ setText(String)
public class HelpBrowser {
    private List history = new ArrayList();
    private JToolBar toolBar;
    private JEditorPane htmlPane;
    private JLabel statusBar;

    private HelpBrowser(Frame parent) {
        toolBar  = createToolBar();
        htmlPane = new JEditorPane();
        htmlPane.setContentType("text/html");
        htmlPane.setEditable(false);
        statusBar = new JLabel();
    }

    private void setPage(URL url, boolean logHistory) {
        htmlPane.setPage(url);
        if (logHistory) {
            addToHistory(url);
        }
    }
}