Is there a way to disable JTextArea from keystrokes?

I have a JTextArea which I am using to display messages only, is there a way to disable any typing on it?

Theta.
thetaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
adam923Connect With a Mentor Commented:
i can't change my comment to an answer but you can....
or i'll just submit this as the answer, it's all the same
0
 
adam923Commented:
call the method setEditable(false) on the jtextarea
0
 
venkat2000120699Commented:
U can as well call setEnabled(false).
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
adam923Commented:
please revert your answer to a comment... it amounts to the same thing that i said, just 2.5 hours later

setEditable and setEnabled would both work just as well... there are subtle differences but none that you'll notice in a simple application
0
 
rjackmanCommented:
or u can use JTextArea.setEnable(false);
which will cause Jtextarea to be disbled totally
RJackman
0
 
thetaAuthor Commented:
adam923 I am rejecting venkat2000's answer, change your comment to an answer so that I can accept it.

Thanks.
Theta.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.