File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes Maintain the Foreground text color in JList[urgent] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Maintain the Foreground text color in JList[urgent]" Watch "Maintain the Foreground text color in JList[urgent]" New topic
Author

Maintain the Foreground text color in JList[urgent]

netharam ram
Ranch Hand

Joined: Aug 09, 2001
Posts: 202
Hi, I have a JList with some String elements.When I set setEnabled(false), the text's foreground color becomes dull.How to avoid this dull screen over the JList even after setEnabled(false).Please reply as soon as possible.
Happy middling with java.
Netharam
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

It "grays out" the label to show the user that it cannot be selected... normally, this is really something you would really want to do...

But if you don't you'll have to override the default ListCellRenderer...



-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
Hi. I want to do the same thing but with a JTextField. Can anyone tell me how this is done?
By the way, does anyone know a good book that has little tips like these, or is it just common knowledge after working with Java for so long?
Thanks for your help!!
 
wood burning stoves
 
subject: Maintain the Foreground text color in JList[urgent]