Java Swing: How to get TextArea value including the char just typed?

前端 未结 3 1717
星月不相逢
星月不相逢 2021-01-27 02:05

What\'s the best way to get a value of a TextArea after a key is typed, including this character?

If I do it in the even listener, textarea.getText() return

3条回答
  •  失恋的感觉
    2021-01-27 02:37

    You need to use a DocumentListener and wirte your code in one of the xxxupdate() methods.

提交回复
热议问题