How can I save the content of JTextPane as an html file?

Sandip Chitale

Say the content type of the JTextPane was of MIME type "text/html" then you can do -

import javax.swing.text.html.*;


JTextPane p = new JTextPane();


HTMLDocument hd = (HTMLDocument) p.getDocument();
HTMLWriter hw = new HTMLWriter(outputStream, hd);
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.