Hello.
You need to learn about ActionListener in java.
Using this listener you connect your button to the method which sets the background.
A post is already available in the forum I think...