Java jeditorpane rtf images

688 views Asked by At

I would like to get a JEditorPane to display RTF images like microsoft wordpad. I have a simple program I got from an example off of the web. I created a demo file in wordpad with all of the styles wordpad supports. Strikethrough, super-script, sub-script and highlight are not being read or displayed when reading the file. Highlight would be nice other than that I don't really need the others. The part that is critical is the images in the RTF, they show in wordpad but on in java. I am using:

RTFEditorKit rtf = new RTFEditorKit();
JEditorPane editor = new JEditorPane();
editor.setEditorKit(rtf);
rtf.read(fi, editor.getDocument(), 0);

If RTFEditorKit cannot support images is there a editor kit that can? I can't be the only person to try to get an RTF to work properly. I cannot use an HTML editor kit because I need the images to be embeded like the RTF format.

0

There are 0 answers