I know we can set html as JTextPane content type and then use img tag to display image but here I have image data in bytes and img do not accept bytes it just wants url. So how can I show that image in JTextPane? Any other solution for this situation?
I have tried storing image temporary at Temp directory and then give it’s url in img but didn’t get any success.
The only way is to use JEditorPane instead of JTextPane. There you would have to set HTMLEditorKit. After that, following html should work (only with absolute paths).
More information is at http://download.oracle.com/javase/tutorial/uiswing/components/editorpane.html