🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10044

Re: HTML as stream

#10044
From: Marc Palmer
Date: Thu, 25 Nov 1999 00:00
32 lines
1798 bytes
In article <383c25ba.13503289@forums.borland.com>, wbelcore@ats.it 
says...
> is it possibile with a editopane display a html not form a file but
> from strem?
> I want that my user when click on a jdbtable row, a jeditorpane
> display data (from colums) into html format (with links) without write
> a htm temp file.

Yes, but it's not fun and I can't claim 100% success.

You need to create an HTMLDocument yourself, and get it to read from your 
stream. Then you call setDocument( ... ) with it. However, I'm pretty 
sure you have to set the EditorKit too as it probably can't tell what 
you're giving it...

so in pseudocode:

 editor.setEditorKit( editor.getEditorKitForContentType( "text/html"));
 HTMLDocument yourdoc = new HTMLDocument();
 HTMLEditorKit.read( yourstream, yourdoc, 0);
 editor.setDocument( yourdoc);

However with similar code to this I am getting a different layout of the 
page to when I just call setPage( myurl) for the same document. Very 
strange.

Cheers
-- 
Marc Palmer (all views are my own and not representative of Cardiacs)

If you haven't heard CARDIACS may I respectfully advise you
to visit http://www.cardiacs.com/button.html
Technical Details
Message-ID: <MPG.12a743d91e995c209897c9@192.168.200.5>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <383c25ba.13503289@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,6bf1314fb8781608
X-Google-Attributes: gid111d45,public
From: Marc Palmer <marc@anyware.co.uk>
Subject: Re: HTML as stream
Date: 1999/11/25
Message-ID: <MPG.12a743d91e995c209897c9@192.168.200.5>
X-Deja-AN: 552912480
X-NNTP-Posting-Host: anyware.demon.co.uk:193.237.14.77
References: <383c25ba.13503289@forums.borland.com>
X-Trace: news.demon.co.uk 943535140 nnrp-12:18611 NO-IDENT anyware.demon.co.uk:193.237.14.77
Organization: AnyWare Ltd.
Newsgroups: borland.public.jbuilder.java.swing
X-Complaints-To: abuse@demon.net