Solved

TextArea display Only

Posted on 1998-04-21
1
269 Views
Last Modified: 2012-06-27
I have a textarea that I have enabled and editable is false.  But the user can highlight and place the cursor in the textarea.  How do I prevent the user for being able to do that but slight allow them to scroll?
0
Comment
Question by:bcsystem
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 1

Accepted Solution

by:
dufort earned 10 total points
ID: 1219232
Here's how I would do it : design a Container class that has a CardLayout. On the first card, put your TextArea. On the second card, put a MultiLineLabel in a ScrollPane (the code for the MultiLineLabel component can be found easily on the Internet, just dig a little and you'll find it).

Ok, now suppose you called your special container class ProtectedTextArea.
- ProtectedTextArea.setEditable(true) will bring the first card on top with CardLayout's first() method.
- ProtectedTextArea.setEditable(false) will copy the TextArea's text to the MultiLineLabel and put its ScrollPane on the top with CardLayout's last() method.

That should really be a piece of cake once you got a MultiLineLabel class; I guess you can program your ProtectedTextArea class in less than 30 lines.

0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

707 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