import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
/** Applet mit einfacher Spielautomaten-Funktionalitaet
  * durch drei farbige Labels bzw. Start/Stop-Buttons             
  */
public class AutomatApplet extends JApplet {
  Container c;
  ColorRunLabel rotAnzeige, gelbAnzeige, gruenAnzeige;
  StartStopButton rotKnopf, gelbKnopf, gruenKnopf;
  public void init() {
    c = getContentPane();
    rotAnzeige = new ColorRunLabel(Color.RED);
    gelbAnzeige = new ColorRunLabel(Color.YELLOW);
    gruenAnzeige = new ColorRunLabel(Color.GREEN);
    rotKnopf = new StartStopButton(Color.RED);
    gelbKnopf = new StartStopButton(Color.YELLOW);
    gruenKnopf = new StartStopButton(Color.GREEN);
    c.setLayout(new GridLayout(2,3,5,5));
    c.add(rotAnzeige);
    c.add(gelbAnzeige);
    c.add(gruenAnzeige);
    c.add(rotKnopf);
    c.add(gelbKnopf);
    c.add(gruenKnopf);
    rotKnopf.addActionListener(new KnopfListener(rotAnzeige, 
                                                 rotKnopf));
    gruenKnopf.addActionListener(new KnopfListener(gruenAnzeige, 
                                                   gruenKnopf));
    gelbKnopf.addActionListener(new KnopfListener(gelbAnzeige, 
                                                  gelbKnopf));
  } 
}
