• Post Reply Bookmark Topic Watch Topic
  • New Topic

rendering a jcomboBox  RSS feed

 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

Below is my code. I would like to add different colors to the items in the comboBox (eg, group 1-yellow, group 2-green)

first, is it possible?
second, I know there suppose to be renderListener, does anyone have any example.

thanks
Peter
 
Joe Ess
Bartender
Posts: 9429
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java Tutorial: How to Use Combo Boxes: Using a Custom Renderer
 
Peter Primrose
Ranch Hand
Posts: 755
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, so I dig a little bit and i found what i needed.
I created my rendering and this is my code:



Question: without using focuslistener how can I set the choosen color as the background color AFTER the item has been choosen?

Thanks
Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!