Re: cobbling a ComboBox



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"
.



Relevant Pages

  • Re: can i bold what i type
    ... >I am having problems seeing and I was wondering how to bold the address bar ... Press Win-U to enter it via the Accessibility Utility Manager. ... I was only able to find a way to Bold the Address bar ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Change Fonts in Windows Explorer, etc.
    ... Turn on Bold ... Use the Item dropdown and select Captions Buttons (or Active Title Bar ... I don't use OE for newsgroups. ...
    (microsoft.public.windowsxp.newusers)
  • cobbling a ComboBox
    ... I would like to use the color on the top title bar to use it as the ... Which is the grey color of the default Window background in the Metal L&F ... Also I don't know how to only have the selection boldened (as in the window ... I would like for it to be bold only when you select it ...
    (comp.lang.java.gui)
  • Re: How can I bold a symbol in an Equation object in Word 2003?
    ... > How can I bold a symbol in an Equation object in Word 2003? ... With Equation Editor open, Word's menu bar ... Style> Define and make sure "Bold" is checked for all settings. ... You can download a free evaluation copy of MathType at the link ...
    (microsoft.public.word.docmanagement)
  • Re: Status bar font size
    ... > Is there any way of making the status bar more legible? ... > I have a reduced vision problem, and would like to increase font size ... > bold it if possible. ... > TIA ...
    (microsoft.public.visio.general)