I have a JButton
that I would like to change the background color of to white. When using the Metal Look And Feel, I achieve the desired effect with setB
Your best option is using SwingX:
JXButton allows you to set a Painter for the background with .setBackgroundPainter(Painter)
using a MattePainter achieves exactly what you want. Having that JXButton extends from JButton, the changes are minimal in your code:
Color bg = new Color(new Random().nextInt(16777215)); // Random color
JButton button = new JButton();
button.setBackground(bg);
would become
JXButton button = new JXButton();
button.setBackgroundPainter(new MattePainter(bg));