import java.awt.event.*; //grafisches Programm Teil 2
import java.awt.*;
public class a37 extends Panel implements ActionListener{
	Button b1 = new Button ("Schwarz");
	Button b2 = new Button ("Blau");
	Button b3 = new Button ("Gelb");
	boolean lichtAn = false;
	public a37(){
		setBackground(Color.white);
		add(b1);
		b1.addActionListener(this);
		add(b2);
		b2.addActionListener(this);
		add(b3);
		b3.addActionListener(this);
	}
	public void actionPerformed(ActionEvent e){
		if(e.getSource().equals(b1)) setBackground(Color.black);
		else				
		if(e.getSource().equals(b2)) setBackground(Color.blue);
		else				
		if(e.getSource().equals(b3)) setBackground(Color.yellow);

	}
	public static void main(String a[]){
		Frame Fenster = new Frame("Aufgabe 37");
		Fenster.add("Center", new a37());
		Fenster.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e) {System.exit(0); } } ) ;
		Fenster.pack();
		Fenster.setSize(300,300);
		Fenster.setVisible(true);
	}
}