 <p>I've finally found a workaround.</p> <p>In netbeans, I've set the background property of the button to some value (different from the one I want, but different from the default 240,240,240 too).</p> <p>When I run the applet, now I always get what I expect, that is the color set in the code with Nimbus.</p>