Article View: borland.public.jbuilder.java.swing
Article #10907Re: How to colour a JComboBox
From: Tor Iver Wilhelmsen
Date: Thu, 05 Aug 1999 00:00
Date: Thu, 05 Aug 1999 00:00
20 lines
1254 bytes
1254 bytes
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:
<u3dxyfrqf.fsf@sds.no>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37A9587A.E373BFCA@cwcom.co.uk>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,55ab3afbc54dff3e X-Google-Attributes: gid111d45,public From: Tor Iver Wilhelmsen <tor.wilhelmsen@sds.no> Subject: Re: How to colour a JComboBox Date: 1999/08/05 Message-ID: <u3dxyfrqf.fsf@sds.no> X-Deja-AN: 509129554 Sender: towi@SDSA1761 References: <37A9587A.E373BFCA@cwcom.co.uk> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing