xxxxxxxxxx
// Initialize the button
JButton button = new JButton("Your button label here...");
// Set the color of the background
button.setBackground(Color.Black);
// Set the color of the text
button.setForeground(Color.White);
xxxxxxxxxx
AbstractButton button = (AbstractButton) e.getSource();
Color color = button.getBackground();