> I think I'm a bit confused.  Do you override the drawBackground to create
an
> overlay???  I am not trying to change the background color, my
itemrenderer
> has an image and I need to draw a rectangular overlay over the top of the
> image.  Will this accomplish that?

No, but you can do whatever you want to do in this method. The important
bit is that this method appears to get called when you need to refresh the
UI in some way. In particular, I've been using this method to change the
appearance of the item renderer when it is selected or deselected, which is
what you want, so using this method would work for you, if you were using
LabelItemRenderer...

> Also, I am using a standard ItemRenderer and not a LabelItemRenderer and
> there does not appear to be a drawBackground() method in this class.  Is
> there a similar method that I can override in a regular ItemRenderer??

I don't know. It looks like you may need to dig into the LabelItemRenderer
code and see what events are causing the drawBackground() method to fire.
I'd either simply look at LabelItemRenderer's code, or create a simple app
that uses LabelItemRenderer, put a breakpoint into drawBackground(), then
select the item and look at the stack trace.

Reply via email to