From owner-freebsd-java Wed Jun 17 14:53:53 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA15923 for freebsd-java-outgoing; Wed, 17 Jun 1998 14:53:53 -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 OAA15909 for ; Wed, 17 Jun 1998 14:53:49 -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 QAA27457; Wed, 17 Jun 1998 16:53:48 -0500 (CDT) Date: Wed, 17 Jun 1998 16:53:48 -0500 (CDT) From: Steve Price To: Sean Kelly cc: java@FreeBSD.ORG Subject: Re: displaying HTML docs with JEditorPane? In-Reply-To: <3588379D.C74EB63@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 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