Solved

Is there a way to disable JTextArea from keystrokes?

Posted on 2000-04-24
6
631 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now