简体   繁体   中英

How to implement in JEditorPane on text changed

如何在JEditorPane中实现文本更改方法(在添加或删除的每个字符上获取文本)?

You need to register a document listener with the document of the JEditorPane which will be notified when text is inserted or removed or when the text style changes.

Take a look at Java Tutorial > How to Write a Document Listener for more information about document listeners and document events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM