I
Ike
If I have a string, in html format....
String s ="<html><b><h2>testing</h2></b><font color=red><br>is this in
red?</font>"
and I wish to display it, formatted, in a JEditorPane.....
JEditorPane messageTextArea = new JEditorPane();
HTMLDocument hdoc = new HTMLDocument();
messageTextArea.setDocument(hdoc);
How can I now set this string into the JEditorPane, and have it appear
formatted? I know I can do this with hdoc.setPage(URL) if I have a URL, but
I have a string, not a URL. I have tried
try{
insertString(0, s, attr);
}catch(javax.swing.text.BadLocationException ble){}
With no luck, as that only shows me the unformatted text. How can I set a
string of HTML text into an HTMLDocument ? Thanks Ike
String s ="<html><b><h2>testing</h2></b><font color=red><br>is this in
red?</font>"
and I wish to display it, formatted, in a JEditorPane.....
JEditorPane messageTextArea = new JEditorPane();
HTMLDocument hdoc = new HTMLDocument();
messageTextArea.setDocument(hdoc);
How can I now set this string into the JEditorPane, and have it appear
formatted? I know I can do this with hdoc.setPage(URL) if I have a URL, but
I have a string, not a URL. I have tried
try{
insertString(0, s, attr);
}catch(javax.swing.text.BadLocationException ble){}
With no luck, as that only shows me the unformatted text. How can I set a
string of HTML text into an HTMLDocument ? Thanks Ike