JTextArea: don't create a newline when i press Enter

how do that?thanks.
[33 byte] By [NhTina] at [2007-11-26 17:07:53]
# 1
KeyStroke enter = KeyStroke.getKeyStroke("ENTER");textArea.getInputMap().put(enter, "none");
camickra at 2007-7-8 23:35:43 > top of Java-index,Desktop,Core GUI APIs...
# 2
when i compile, a error at line:textArea.getInputMap().put(enter, "none");error: The method getInputMap() is undefined.?
NhTina at 2007-7-8 23:35:43 > top of Java-index,Desktop,Core GUI APIs...
# 3

Then you are probably using a TextArea. You should be using JTextArea.

If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.

And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.

camickra at 2007-7-8 23:35:43 > top of Java-index,Desktop,Core GUI APIs...
# 4
sorry about that.i tried it again with JTextArea and okay, thanks.
NhTina at 2007-7-8 23:35:43 > top of Java-index,Desktop,Core GUI APIs...