JPanel has a setBackground() method, it's probably easier. Might have to setOpaque(true) first though.