I'm using a ListCellRenderer
, and I need to display the drawn items slightly different dependent on whether they are drawn as part of the drop-down list or as part of the combo box' inline images (i.e. the selected item in non-dropped down mode).
Using the isSelected
parameter of the renderer's getListCellRendererComponent
to detect this obviously down not work, since this reflects whether the item is selected in the list, not whether the item is the current final selection that is also drawn inline within the combo box.
I've found the solution: the parameter index
of the renderer's getListCellRendererComponent
is -1
when the inline control is drawn.