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

前端 未结 3 1719
星月不相逢
星月不相逢 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:54

    Have you tried registering a KeyListener with a custom implementation of keyReleased(KeyEvent e) ?

    check the api here: KeyListener

    sun's tutorial with examples: How to write a Key Listener

提交回复
热议问题