File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Disable EnterKey action for JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable EnterKey action for JTextArea" Watch "Disable EnterKey action for JTextArea" New topic
Author

Disable EnterKey action for JTextArea

Damithri Warnakulasuriya
Greenhorn

Joined: Apr 18, 2008
Posts: 17
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

Joined: Jun 09, 2003
Posts: 4632
http://www.coderanch.com/t/415962/GUI/java/JtextArea
Damithri Warnakulasuriya
Greenhorn

Joined: Apr 18, 2008
Posts: 17
Oh Thank you very much for the early reply. Thanks for the help as well.
 
Consider Paul's rocket mass heater.
 
subject: Disable EnterKey action for JTextArea