replacing text in jTextArea by image
i'm supposed to read text from a jtextarea, compare if any characters correspond to those in an array, no prob here but i'm having hard time to append a image to a particular set of characters. I mean after having found them in the jtextarea use jtextarea's replacerange to do the job, but as this function replaces some string by another string, i tried using html in the first parameter to load it in it. Example:
where WINK is
jTextArea3.replaceRange("<IMG SRC=\""+WINK +"\">", text.length()-1, text.length());
i've seen others do it this way, but i doesn't seem to work for me.
final String WINK = ClassLoader.getSystemClassLoader().getResource("images/3.gif").toString();
i tried using jtextpane but i can't find how to replace text at a particular index with an image.
So my question would be. Does anyone know how to append text at a partcular index in the jtextarea so as to replace it by an image.