Article View: borland.public.jbuilder.java.swing
Article #7865JEditorPane, HTML and SaveToFile
From: Adrian Tarau
Date: Mon, 04 Dec 2000 00:00
Date: Mon, 04 Dec 2000 00:00
20 lines
1035 bytes
1035 bytes
Hi,
I have a small HTML editor using JEditorPane. After I changed colors, fonts,
etc., I want to save it in a file. The saved file is not the the content of
the JEditorPane !! There are missing all the formating tags (font , colors).
Where is the problem ????
Here I have the code :
FileWriter fo = new FileWriter("demo.html");
HTMLEditorKit kit = (HTMLEditorKit)para.getEditorKit();
HTMLDocument doc = (HTMLDocument)para.getDocument();
try {
kit.write(fo,doc,0,doc.getLength());
} catch(Exception ex) {
}
fo.flush();
fo.close();
Technical Details
Message-ID:
<90g495$46q3@bornews.inprise.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,c0fa0aecc027ee4c,start X-Google-Attributes: gid111d45,public From: "Adrian Tarau" <ady@datagroup.ro> Subject: JEditorPane, HTML and SaveToFile Date: 2000/12/04 Message-ID: <90g495$46q3@bornews.inprise.com> X-Deja-AN: 700930651 X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Organization: Level 7 X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing