title: Java Swing JEditorPane: manipulating styled documents
body: <p>I have model that is a queue of Strings associated with enum types.</p>
  
  <p>I'm trying to display that model in a JEditorPane, with each element in the queue as a separate HTML paragraph that has attributes based based on the associated enum type.</p>
  
  <p>However, my updating methods are not doing what I want.  I tried writing the HTML strings directly to the document (e.g., I take the Strings, prepend <code>&lt;p style="color:red"&gt;</code> and append <code>&lt;/p&gt;</code> and then insert them at the end of the document), but that gives me the html tags in the output (instead of as formatting) - which of course is inconsistent with the result of putting the tags on the string that I use construct the document with JEditorPane("text/html",String foo).  I've also tried inserting with an AttributeSet, but apparently I'm doing that wrong as well.</p>
  
  <p>Any suggestions?</p>