Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #3699

Re: cobbling a ComboBox

From "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this>
Subject Re: cobbling a ComboBox
Message-ID <g3pac7$aki$1@registered.motzarella.org> (permalink)
Newsgroups comp.lang.java.gui
References <1214257403.665864@nntp.acecape.com>
Date 2011-04-27 15:46 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
On 2008-06-23 23:43 +0100, Albretch Mueller allegedly wrote:
>  I have a JComboBox that looks like this:
> 
>  http://www.geocities.com/tekmonk2005/pix/ComboBoxColors.jpg
> 
>  I would like to use the color on the top title bar to use it as the
> background of the selected item in the combobox, so it kind of looks like a
> continuation of what was suggested in the title bar
> 
>  But I don't know how to ask the UI Manager to give me the color of the top
> title bar a JFrame uses. If you go:
> 
>  UIManager.get("InternalFrame.borderColor")
> 
>  you will get something like:
> 
>  javax.swing.plaf.ColorUIResource[r=238,g=238,b=238]
> 
>  Which is the grey color of the default Window background in the Metal L&F

Try UIManager.getColor(Object).

>  Also I don't know how to only have the selection boldened (as in the window
> bar), when the selection is made. If you go:
> 
>  UIManager.put("ComboBox.font", new Font("Monospaced", Font.PLAIN +
> Font.BOLD, 16));
> 
>  The font stays bold all the time
> 
>  I would like for it to be bold only when you select it
> 
>  Is this possible?

Don't know about that. You might try to dump all the UIManager keys
(UIManager.getDefaults().keySet()) and look for the appropriate key.
Alternatively, find a webpage which lists all of them -- unfortunately,
I'm not aware of such a resource.

Chances are such nuanced behaviour as you want may not be available. In
that case, you may end up having to write/override the ComponentUI itself.

-- 
DF.
to reply privately, change the top-level domain
in the FROM address from "invalid" to "net"

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
  Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
    Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
      Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
        Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
          Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
            Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
              Re: cobbling a ComboBox "Albretch Mueller" <albretch.mueller@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000
                Re: cobbling a ComboBox "Daniele Futtorovic" <daniele.futtorovic@THRWHITE.remove-dii-this> - 2011-04-27 15:46 +0000

csiph-web