Solved

Is there a way to disable JTextArea from keystrokes?

Posted on 2000-04-24
6
651 Views
Last Modified: 2008-03-03
I have a JTextArea which I am using to display messages only, is there a way to disable any typing on it?

Theta.
0
Comment
Question by:theta
6 Comments
 
LVL 4

Expert Comment

by:adam923
ID: 2746044
call the method setEditable(false) on the jtextarea
0
 
LVL 2

Expert Comment

by:venkat2000120699
ID: 2746338
U can as well call setEnabled(false).
0
 
LVL 4

Expert Comment

by:adam923
ID: 2746357
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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 3

Expert Comment

by:rjackman
ID: 2746493
or u can use JTextArea.setEnable(false);
which will cause Jtextarea to be disbled totally
RJackman
0
 

Author Comment

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

Thanks.
Theta.
0
 
LVL 4

Accepted Solution

by:
adam923 earned 25 total points
ID: 2748359
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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
ArrayIndexOutOfBoundException 9 81
eclipse argument 14 61
windows explorer path to command prompt 5 44
use lov values 2 50
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question