Override JTextArea.getDocument.remove ()?

Ok, I want to override the JTextArea document deletion method, I can’t figure out which class should be extended. I cannot extend Document because it is an interface, and this also means that it should not be a document created by JTextArea. So, how exactly can I easily override the JTextArea document deletion method?

+3
source share
2 answers

By default , as indicated in . Here is a simple example of overriding in .Document JTextArea PlainDocumentcreateDefaultModel()insertString()PlainDocument

+2
source

Try using DocumentFilter instead.

0

Source: https://habr.com/ru/post/1769928/


All Articles