JButton's Background

Hello,

How do I change the color of a button. I have a button that has a gif image on top of it, but I want to change the color of the button itself to match the picture.

b1 = new JButton (new ImageIcon("play.gif"));

The button shows up fine, with the picture in it, but the button's background color is different. I'd like to change that so it doesn't look like an image over a button.

Thanks!

[428 byte] By [xonadicka] at [2007-9-29 20:34:04]
# 1
This question falls under the Swing, so please post ur questions in the relevent forum. For your question, try this.button.setBackground(Color.green);// color of ur choiceThis will change the button's background color.
iffy24a at 2007-7-16 0:45:46 > top of Java-index,Other Topics,Algorithms...