• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable EnterKey action for JTextArea

 
Damithri Warnakulasuriya
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is anyone knows, how to disable enter key for JTextArea?

If someone types something in a JTextArea and presses Enter key, then cursor goes down (Starts a new line).
What I want is to disable that action and cursor should be as it is without moving to a new line when user presses the enter key.

Please help me.

Thank you
 
Michael Dunn
Ranch Hand
Posts: 4632
 
Damithri Warnakulasuriya
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh Thank you very much for the early reply. Thanks for the help as well.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic