This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
 
Similar Threads
TextArea and ActionEvent
jtextpane help
Automatic indentation
JSF form: using ENTER as TABULATOR key
disabling ENTER key