Posted By:
George_Tzallas
Posted On:
Tuesday, July 23, 2002 01:59 AM
You will have to override method
insertString (int, String, AttributeSet)of
javax.swing.text.StyledDocument, parse the input string, and replace any occurrences
of the pattern you want with the icon.
This is roughly an outline of the steps you will need to take. For the implementation I can only
give you two examples (there is a lot of coding involved)
- Check JTextField for
an example on how to override insertString (top of the document, provides an example on how
to convert input to uppercase, faily simple)
- Check /demo/jfc/StylePad for an example on how to display
a complex document (with styles and images)
Hope this helps
Regards
George T