Any component has a parent component field, so evidently it can only be put in a view hierarchy once.
If you use a content type of the JTextPane styled text, like "text/html" you can insert images too. There is a swing demo with Alice in Wonderland providing low level image objects. In HTML one could add a <img src='...'>
where the src
either is a file:...
or maybe some own protocol to get the image from the classpath (res:
, resource:
or classpath:
). To write a protocol handler is not difficult, just a bit baroque.
Probably this answer suffices, which answers "JEditorPane with inline image."