Java Swing JEditorPane: manipulating styled documents -
I have a model that has a line of strings associated with an anonymous type.
I'm trying to display the model Jeiditrpan, show each element in the queue as a separate HTML paragraph, which related attributes based on Aanaim type.
However, my updates are not what I want. I tried to write the HTML string directly in the document (for example, I get the strings, & lt; p style = "color: red">
and & lt; / p & gt;
and then insert them into the end of the document), but it does html tag I output (rather than formatting) - which is certainly inconsistent with the results of putting the tag on the string The document that I create with JEditorPane ("text / html", string foo) I have also tried to put it with AttributeSet, but apparently I am also doing this wrong.
Any suggestions?
I have not played much luck with HTML in Jedarapana. I have only one feature in JTextPane Something like this:
Simple ExerciseSat Keyword = New SimpleAttetsat (); StyleConstants.setForeground (keywords, colors .radi); StyleConstants.setBackground (keywords, colors. Yellow); StyleConstants.setBold (keyword, true); Try {doc.insertString (doc.getLength (), "\ n some more text", keywords); } Hold (exception e) {}
Comments
Post a Comment