How to replace string with image( Say Emoticons )?

Hello Friends !!I am working on chat messenger and want some help in "How to access Emoticons when somebody typed :), ;), :)) and many more strings.....?"Is there any sample code to do that job or any function to perform such task?Thanks in Advance....
[289 byte] By [bronze-starDukes] at [2007-11-26 12:14:17]
# 1
use event listener... found match, load image instead of text on the fly.
bronzestar at 2007-7-7 14:16:41 > top of Java-index,Archived Forums,Socket Programming...