Help write your own javax swing. text. Document
I am writing a Java textcomponent in which the underlying document has some structure It's very short, basically one line I need a response that can override the insertion or deletion of characters in some parts of the document
My initial approach was to implement javax swing. text. Document, but this seems to involve developing many related classes (element, editorkit, view), and there doesn't seem to be many examples or tutorials on how to perform this operation There are many ways to use predefined implementations
Anyone can point to my tutorial or other aids to simply implement document and what other classes I need to create to make it work
Solution
If you only want to respond to character insertion / deletion, documentfilter may be a better method This will allow you to block the insertion of characters in the document you want Read the jtextfield API and follow the swing tutorial link in "text component functions" for more information