Inserting preformatted html text
843805May 7 2007 — edited May 7 2007Hello,
I am writing an application to edit some preformatted html text, entered in a html TEXTAREA. I know that html text break lines with '%0D%0A', but how do I insert some preformatted text into JEditorPane without writing code to search for this?
I have tried
String HTMLInput = getParameter("TEXTAREA_INPUT");
htmlEditorKit.insertHTML(htmlDocument, 0, HTMLInput, 0, 0, HTML.Tag.PRE);
and StringBuffer.readLine() to find the new lines so that I could replace them with '\n' but this doesn't work either.
I have to use JEditorKit because my application is already written using that so using JTextPane is out of the question.
Any ideas? I can send you some sample code if you would like to see the problem in action. It is in three files because I need a form to get the input, a JSP that has an <object> tag that passes a param to the applet containing the JEditorPane
Message was edited by:
jasinner