Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Greying out a text box using java swing

Posted on 2010-08-12
6
Medium Priority
?
720 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
[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
  • 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
Technology Partners: 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!

 

Author Comment

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

Accepted Solution

by:
gtagliani earned 1000 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

Independent Software Vendors: 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

Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

636 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