/*
 * File: ColorFunACM.java
 * ---------------------
 * This implements a changing background color program using the ACM Libraries!
 */

import acm.program.*;
import javax.swing.*;

import java.awt.Color;
import java.awt.event.*;

public class ColorFunACM extends Program {
	public void init() {
		JButton redButton = new JButton("Red!");
		JButton blueButton = new JButton("Blue!");
		add(redButton, SOUTH);
		add(blueButton, SOUTH);
		addActionListeners();
	}

	public void actionPerformed(ActionEvent e) {
		if(e.getActionCommand().equals("Blue!")){
			setBackground(Color.BLUE);
		} else {
			setBackground(Color.RED);
		}
	}
}


