import java.awt.event.*; //grafisches Programm
import java.awt.*;
public class a34 extends Panel implements ActionListener{
	Button b = new Button ("Lichtschalter");
	boolean lichtAn = false;
	public a34(){
		setBackground(Color.black);
		add(b);
		b.addActionListener(this);
	}
	public void actionPerformed(ActionEvent e){
		lichtAn = lichtAn?false:true;
		if(lichtAn) setBackground(Color.black);
		else		setBackground(Color.green);
	}
	public static void main(String a[]){
		Frame Fenster = new Frame("Aufgabe 43");
		Fenster.add("Center", new a34());
		Fenster.addWindowListener(new WindowAdapter(){
			public void windowClosing(WindowEvent e) {System.exit(0); } } ) ;
		Fenster.pack();
		Fenster.setSize(300,300);
		Fenster.setVisible(true);
	}
}