From owner-freebsd-java Wed Jun 17 14:39:56 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA12740 for freebsd-java-outgoing; Wed, 17 Jun 1998 14:39:56 -0700 (PDT) (envelope-from owner-freebsd-java@FreeBSD.ORG) Received: from pluto.plutotech.com (mail.plutotech.com [206.168.67.137]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA12719 for ; Wed, 17 Jun 1998 14:39:45 -0700 (PDT) (envelope-from kelly@plutotech.com) Received: from plutotech.com (tampopo.plutotech.com [206.168.67.161]) by pluto.plutotech.com (8.8.7/8.8.5) with ESMTP id PAA29806; Wed, 17 Jun 1998 15:39:41 -0600 (MDT) Message-ID: <3588379D.C74EB63@plutotech.com> Date: Wed, 17 Jun 1998 15:39:41 -0600 From: Sean Kelly Organization: Pluto Technologies X-Mailer: Mozilla 4.04 [en] (X11; I; FreeBSD 3.0-CURRENT i386) MIME-Version: 1.0 To: Steve Price CC: java@FreeBSD.ORG Subject: Re: displaying HTML docs with JEditorPane? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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