JButton background on Nimbus LAF
问题 I use Nimbus LAF and I want to change the background of a simple JButton . JButton jbutton = new JButton("test"); jbutton.setBackground(Color.BLACK); But it doesn't work, when I change the look and feel it works but it doesn't work in Nimbus. How can i do it? Thanks for your help. 回答1: Nimbus uses Painter to paint the different Styles. By Default the Button has a gradient not a single Color. See Button: Nimbus Defaults List You can write your own Painter and override the default. Or you