This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Each Item With Different text Color in a combox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Each Item With Different text Color in a combox" Watch "Each Item With Different text Color in a combox" New topic
Author

Each Item With Different text Color in a combox

Muhammad Ahsan Jamshaid
Ranch Hand

Joined: Jun 01, 2006
Posts: 59
HI..
i am Using combobox for the selecting font color Selection... i want to display each Color in combobox with same the font color as its name... like Pink Text should be in Pink Color and Red Should be displayed with RED with Red Text Color in the Combobox...
Any Idea or Clue...... Surely awaiting some good solution..
--Jamshaid..


--Ahsan Jamshaid... SCJP 5(80%)
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
this might be one way

Muhammad Ahsan Jamshaid
Ranch Hand

Joined: Jun 01, 2006
Posts: 59
Thanks... It Worked......
--Jamhaid..
Muhammad Ahsan Jamshaid
Ranch Hand

Joined: Jun 01, 2006
Posts: 59
My concepts regarding Playing with renderer class is week.. can any one refer me a good link or notes to study...

--Jamshaid..
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
doesn't look like there's a lot, but this has some info.
some of the examples on the page might be worth going through.

http://java.sun.com/docs/books/tutorial/uiswing/components/combobox.html#renderer
 
GeeCON Prague 2014
 
subject: Each Item With Different text Color in a combox