🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

How to render JEditorPane to Graphics without showing?

#10072
From: Marc Palmer
Date: Mon, 15 Nov 1999 00:00
24 lines
1388 bytes
Hi,

I'm trying to get a JEditorPane to paint to an offscreen image 
(BufferedImage). The code works, but only if I put the editor pane into a 
JFrame, show it all, and wait for it to paint before I call 
editorPane.paint( myBufferedImage.getGraphics())

i.e. there are two problems: 

1) I can't tell when the pane has finishes it's asynchronous load/render 
of the page (HTML)
2) I can't get it to render at all unless it has been made visible in a 
frame first.

I'd be grateful if anyone has ideas about how I can do this, or if there 
is a better way of rendering HTML off-screen.

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/sounds.html
Technical Details
Message-ID: <MPG.129a343066ebcfc99897b6@192.168.200.5>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,6b802c95cb575a7b,start
X-Google-Attributes: gid111d45,public
From: marc@anyware.co.uk (Marc Palmer)
Subject: How to render JEditorPane to Graphics without showing?
Date: 1999/11/15
Message-ID: <MPG.129a343066ebcfc99897b6@192.168.200.5>
X-Deja-AN: 548853756
X-NNTP-Posting-Host: anyware.demon.co.uk:193.237.14.77
X-Trace: news.demon.co.uk 942679147 nnrp-01:17868 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