This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes In disabled mode, how do i make JList data to be in black color 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 "In disabled mode, how do i make JList data to be in black color" Watch "In disabled mode, how do i make JList data to be in black color" New topic
Author

In disabled mode, how do i make JList data to be in black color

Smriti Anchu
Ranch Hand

Joined: Dec 21, 2004
Posts: 40
Hi,

I have a JList box in my application. In disabled mode the data in the list box looks embossed. (grey color). I want the list box to be in disabled mode but the font should be black in color. Does anybody know how to do this?

thanks
Smriti
KR Campbell
Ranch Hand

Joined: Mar 26, 2004
Posts: 124
The 'look and feel' takes care of how list items are rendered. Probably, the solution would be to write a new ListCellRenderer to over-ride the default behaviour and then <code> setCellRenderer(myCellRenderer)</code>
Smriti Anchu
Ranch Hand

Joined: Dec 21, 2004
Posts: 40
Hi,
I added Cell renderer but even then it is not working.


But even then it didnt work....It is displaying in grey color only.

I also tried changing the default value by

Even with this it didnt work. Can u tell me whether the cellrendered class which i have written is correct or not.

If its not correct, can u give me some hints

thnx
smriti
 
 
subject: In disabled mode, how do i make JList data to be in black color