earljavadev's answer was pretty straightforward.
it's only one way to do it, but just follow his directions to get the code at the bottom. there are other insert*** methods that you can call to get content into the document as well.
// *** code folows ***
Document doc = myJEditorPane.getDocument();
String imageFile = "myImage.png"; // get the image from a filechooser if you want
Style style = doc.addStyle("StyleName", null); // ignored
StyleConstants.setIcon(style, new ImageIcon(imageFile));
try
{
doc.insertString(doc.getLength(),
"ignored text", style);
}
catch (BadLocationException ble)
{
System.err.println("BadLocationException: " + ble);
}
Well, it's been a long time any you probably have the answer, but in case others are looking
(like I was), you need to use the correct "StyleName" which is "icon", in other words, replace
the String "StyleName" with the String "icon" and it will work. See http://java.sun.com/docs/books/tutorial/uiswing/components/simpletext.html
for a real example.