Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 1998 09:00:17 -0600
From:      Sean Kelly <kelly@plutotech.com>
To:        Steve Price <sprice@hiwaay.net>
Cc:        java@FreeBSD.ORG
Subject:   Re: displaying HTML docs with JEditorPane?
Message-ID:  <3587DA01.715F6993@plutotech.com>
References:  <Pine.OSF.3.96.980616200828.11640A-100000@fly.HiWAAY.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I've never done this, but I'm guessing you need to first create a
Document object that's compatible with HTML.

java.swing.text.Document doc =
java.swing.text.html.HTMLEditorKit.createDefaultDocument();

Then, initialize the doc with the HTML String returned by the server:

doc.insertString(0, stringFromServer, null);

Finally, you can use the setDocument method of the JEditorPane (actually
inherited from JTextComponent):

editorPane.setDocument(doc);

Good luck.
--k

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3587DA01.715F6993>