aspose file tools*
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 Soft Skills this week in the Jobs Discussion 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: In disabled mode, how do i make JList data to be in black color