Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 681
  • Last Modified:

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.
0
theta
Asked:
theta
1 Solution
 
adam923Commented:
call the method setEditable(false) on the jtextarea
0
 
venkat2000120699Commented:
U can as well call setEnabled(false).
0
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
adam923Commented:
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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now