button pressed change color in java swing code example Example: change button color java swing botton.SetBackground(Color.red);