title: How to output using StyledDocument with HTML?
body: <p>I have a <code>JTextPane</code>, and I would like to output text in it using <code>StyledDocument</code>. Here is my <code>StyledDocument</code> object:</p>
  <pre class="lang-java prettyprint-override"><code>StyledDocument dox = (StyledDocument) textArea.getDocument();
  
  Style style = dox.addStyle(&quot;StyleName&quot;, null);
  
  StyleConstants.setFontFamily(style, Font.SANS_SERIF);
  StyleConstants.setFontSize(style, 8);
  dox.insertString(dox.getLength(), &quot;&lt;b&gt;Some Text&lt;/b&gt;&quot;, null);
  </code></pre>
  <p>The problem right now is if I edit the text with html code, it does not display the way I want. I want the text to be displayed as bolded instead of literally <code>&lt;b&gt;Some Text&lt;/b&gt;</code>.</p>
  <p>Is there a way to do this?</p>