user3164187
user3164187

Reputation: 1432

Keybindings in JtextArea to get typed text

Is there any way using keybindings in java to get the text i type in JTextArea in a string variable??

e.g If i type "Stack overflow" in JtextArea , using keybindings i need to get "stack overflow" in a string variable.

I can able to do it using keyListeners(by keypressed event) how can i achieve it in keybindings?

i have implemented keybindings for some keys , so what ever keys other than the specified keys are pressed it should be appended to a variable.

Please help!

Upvotes: 1

Views: 278

Answers (1)

mKorbel
mKorbel

Reputation: 109815

Is there any way using keybindings in java to get the text i type in JTextArea in a string variable??

e.g If i type "Stack overflow" in JtextArea , using keybindings i need to get "stack overflow" in a string variable.

I can able to do it using keyListeners(by keypressed event) how can i achieve it in keybindings?

Upvotes: 4

Related Questions