Re: JComboBox cell renderer doesn't render the top item



On 24 Nov 2005 02:06:34 -0800, "hiwa" <HGA03630@xxxxxxxxxxx> wrote,
quoted or indirectly quoted someone who said :

>Below is an SSCCE for the problem. The renderer renders
>item text in the drop down list in italic font. But it doesn't render
>the top item of the box in italic. What could be the solution. T.I.A.

When I ran in on W2K 1.5.0_05, the various choices, including the top
one were all in italic. The value itself was not.

I added this correction to make the value itself italic.


jcb = new JComboBox(items);
jcb.setFont( jcb.getFont().deriveFont( Font.ITALIC+Font.BOLD ) );
jcb.setRenderer(new ItalicRenderer());

--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.