From owner-freebsd-java Wed Jun 17 14:33:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA11543 for freebsd-java-outgoing; Wed, 17 Jun 1998 14:33:30 -0700 (PDT) (envelope-from owner-freebsd-java@FreeBSD.ORG) Received: from mail.HiWAAY.net (fly.HiWAAY.net [208.147.154.56]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA11528 for ; Wed, 17 Jun 1998 14:33:24 -0700 (PDT) (envelope-from sprice@hiwaay.net) Received: from localhost (sprice@localhost) by mail.HiWAAY.net (8.9.0/8.9.0) with SMTP id QAA18774; Wed, 17 Jun 1998 16:33:23 -0500 (CDT) Date: Wed, 17 Jun 1998 16:33:22 -0500 (CDT) From: Steve Price To: Sean Kelly cc: java@FreeBSD.ORG Subject: Re: displaying HTML docs with JEditorPane? In-Reply-To: <3587DA01.715F6993@plutotech.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Thanks for the response. :) As much as I try I can't seem to get this to work either. :( The relevant code now looks like: import com.sun.java.swing.text.*; import com.sun.java.swing.text.html.*; ... JEditorPane htmlPane = new JEditorPane(); Document doc = HTMLEditorKit.createDefaultDocument(); try { doc.insertString(0, someString, null); } catch (Exception ex) { } htmlPane.setDocument(doc); And when I compile it I see this. javac -classpath .... foo.java:151: Can't make static reference to method com.sun.java.swing.text.document createDefaultDocument() in class com.sun.java.swing.text.html.HTMLEditorKit. Document doc = HTMLEditorKit.createDefaultDocument(); ^ 1 error *** Error code 1 make: Fatal error: Command failed for target `all' I have downloaded an article by Tim Prinzing that I found at the Swing Connection and am reading that right now. I will keep my fingers crossed. Steve On Wed, 17 Jun 1998, Sean Kelly wrote: # # 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