I never did this before. But i can point you some direction.
JTextComponent expose a method called "setDocument", It seems
you can set any document type ( PlainDocument, StyledDocument.. ) to any class derives from JTextComponent. By
default, JTextArea, JTextField, and JPasswordField use PlainDocument as their model. JTextPane uses an instance of DefaultStyledDocument by default. This doesnt mean that you cant change the Document model of those components. You can set any document to any JTextComponent. Look at the following site..
http://manning.spindoczine.com/sbe/files/uts2/Chapter19html/Chapter19.htm It will help you
alot.
[This message has been edited by Sankar Subbiah (edited July 09, 2001).]