I would try to build a customized Document to intercept the input.

Check out: 
http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#
customdocument

Pay attention to its insertString(...) method.

Mingjian Song

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, June 05, 2002 4:03 PM
To: [EMAIL PROTECTED]
Subject: How2 mk JTextArea unresponsive to Enter?





I have two questions regarding the handling of Enter key events by a
JTextArea.

How do I make a JTextArea component entirely unresponsive to the Enter
key?  I want a JTextArea that does nothing (not even inserting a
newline character) whenever the user hits Enter.

And how can I configure a JTextArea so that it does something *other
than* inserting a newline character whenever the user hits Enter?

Thanks!

kj
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing

Reply via email to