Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Nimbus uses Painter to paint the different Styles. By Default the Button has a gradient not a single Color. See Button: <a href="http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/_nimbusDefaults.html" rel="noreferrer">Nimbus Defaults List</a> </p> <p>You can write your own Painter and override the default. Or you override the background color with the key "Button.background" and use the Default Painter.</p> <pre><code>UIDefaults overrides = new UIDefaults(); overrides.put("Button.background", Color.RED); jbutton.putClientProperty("Nimbus.Overrides", overrides); jbutton.putClientProperty("Nimbus.Overrides.InheritDefaults", Boolean.TRUE); SwingUtilities.updateComponentTreeUI(jbutton); </code></pre> <p>Or if you want to change the Color for all Buttons, try:</p> <pre><code>UIDefaults defaults = UIManager.getLookAndFeelDefaults(); defaults.put("Button.background", Color.RED); </code></pre> <p>Btw. The JButton bases on the Nimbus default key "nimbusBase", if you change this color :</p> <pre><code>UIDefaults defaults = UIManager.getLookAndFeelDefaults(); defaults.put( "nimbusBase", Color.RED ); </code></pre> <p>then you change everything that uses the nimbus defalut-blue or a secondary color into your new color, not only the Buttons.</p> <p>I found a nice Nimbus Theme Creator, which can show the effect of changing a Nimbus Default Color to all Components: <a href="http://aephyr.googlecode.com/svn/trunk" rel="noreferrer">http://aephyr.googlecode.com/svn/trunk</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload