title: Inserting images in JEditorPane using pane.getDocument.insert()
body: <p>I am creating a chat application and I want to append strings into JEditorPane, so I am using JEditorPane.getDocument.insert() method to do this:</p>
  
  <pre><code>clientListDoc.insertString(clientListDoc.getLength(),image+"-"+name[0]+"\n", null);
  </code></pre>
  
  <p>But now I also want to display images. I have set the content type to HTML and I use this:</p>
  
  <pre><code>String temp=ClassLoader.getSystemResource("images/away.png").toString();
  image="&lt;img src='"+temp+"'&gt;&lt;/img&gt;";
  </code></pre>
  
  <p>But I don't get images on JEditorPane if I use insert() but when I use setText() images are displayed. Please help!! I want to do both these things!</p>
  
  <p>One approach I though could be to use getText to get the previous strings and append the new string to this string and then use setText() to set the entire string but is there a better solution?</p>