Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 1998 16:53:48 -0500 (CDT)
From:      Steve Price <sprice@hiwaay.net>
To:        Sean Kelly <kelly@plutotech.com>
Cc:        java@FreeBSD.ORG
Subject:   Re: displaying HTML docs with JEditorPane?
Message-ID:  <Pine.OSF.3.96.980617165156.22203B-100000@fly.HiWAAY.net>
In-Reply-To: <3588379D.C74EB63@plutotech.com>

next in thread | previous in thread | raw e-mail | index | archive | help

Ouch.  I guess my brain has stopped for the day.  This
definitely makes it compile, but the text is still not
interpreted as 'text/html'.

Steve

On Wed, 17 Jun 1998, Sean Kelly wrote:

# Ooops!  I misread that `createDefaultDocument' was a static method, but
# it's not.
# 
# Try doing this instead:
# 
# ----
# import com.sun.java.swing.text.*;
# import com.sun.java.swing.text.html.*;
# ...
# JEditorPane htmlPane = new JEditorPane();
# HTMLEditorKit editorKit = new HTMLEditorKit();
# htmlPane.setEditorKit(editorKit); // Necessary?  Dunno.
# Document doc = editorKit.createDefaultDocument();
# try {
#         doc.insertString(0, someString, null);
# } catch (Exception ex) {}
# htmlPane.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?Pine.OSF.3.96.980617165156.22203B-100000>