Link to home
Start Free TrialLog in
Avatar of theta
theta

asked on

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.
Avatar of adam923
adam923

call the method setEditable(false) on the jtextarea
U can as well call setEnabled(false).
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
or u can use JTextArea.setEnable(false);
which will cause Jtextarea to be disbled totally
RJackman
Avatar of theta

ASKER

adam923 I am rejecting venkat2000's answer, change your comment to an answer so that I can accept it.

Thanks.
Theta.
ASKER CERTIFIED SOLUTION
Avatar of adam923
adam923

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial