Solved

Greying out a text box using java swing

Posted on 2010-08-12
6
712 Views
Last Modified: 2013-11-23
Hello All,

How the heck do I grey out my a text field in my application that is written using java-swing?
I just want to indicate to the user that this field is a read only text box.

Thanks in advance!
0
Comment
Question by:expertintraining
  • 4
  • 2
6 Comments
 
LVL 2

Expert Comment

by:gtagliani
ID: 33423134
hi!

try this:

JTextField textboxReadonly = new JTextField("A read-only text field", 20);
textboxReadonly.setEditable(false);

0
 

Author Comment

by:expertintraining
ID: 33423283
BTW, I am using nimbus look and feel
0
 

Author Comment

by:expertintraining
ID: 33423293
gtagliani: I tried that before posting the question...but no luck.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 

Author Comment

by:expertintraining
ID: 33423299
Wondering if it is a nimbus look and feel limitation.
0
 
LVL 2

Accepted Solution

by:
gtagliani earned 250 total points
ID: 33423354
"Wondering if it is a nimbus look and feel limitation."
yes it is.

here is your answer
http://weblogs.java.net/blog/2008/07/31/nimbus-and-opacity
0
 

Author Comment

by:expertintraining
ID: 33425692
Thanks qtagliani, that was it.
:o)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
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.
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…
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

696 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