Article View: borland.public.jbuilder.java.swing
Article #10812Re: How to colour a JComboBox
From: Steve Horsley
Date: Thu, 05 Aug 1999 00:00
Date: Thu, 05 Aug 1999 00:00
27 lines
1543 bytes
1543 bytes
That looks promising. I'll give it a try.
Thanks.
Steve
//--------------------------------
Tor Iver Wilhelmsen wrote:
>
> Steve Horsley <steve.horsley@cwcom.co.uk> writes:
>
> > Does anyone know how to make the drop-down part coloured as well?
>
> You probably will have better success setting the UIDefaults
> properties using UIManager: However, finding out what the property
> keys are is another matter... :-) You can look through the sources of
> javax/swing/plaf/basic to see which properties are looked for.
>
> (Basically, it seems you just put "ComboBox." in front of
> e.g. "background", "foreground", "selectionX" and "disabledX", where X
> is Foreground or Background.)
>
> So to get your desired look, this may work:
>
> UIManager.put("ComboBox.foreground", Color.white);
> UIManager.put("ComboBox.background", Color.blue);
> // Various other settings for the other L&F properties
>
> depending on where you put it.
Technical Details
Message-ID:
<37A96DD5.D4719DAC@cwcom.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37A9587A.E373BFCA@cwcom.co.uk> <u3dxyfrqf.fsf@sds.no>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,55ab3afbc54dff3e X-Google-Attributes: gid111d45,public From: Steve Horsley <steve.horsley@cwcom.co.uk> Subject: Re: How to colour a JComboBox Date: 1999/08/05 Message-ID: <37A96DD5.D4719DAC@cwcom.co.uk> X-Deja-AN: 509135864 Content-Transfer-Encoding: 7bit References: <37A9587A.E373BFCA@cwcom.co.uk> <u3dxyfrqf.fsf@sds.no> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Cable & Wireless Communications Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing