package principal;
import javax.swing.JButton;
import javax.swing.JFrame;
import data.ButtonEventHandler;
import data.Semaphore;
import visual.DrawSemaphore;
public class Main {
public static void main(String[] args) {
JFrame window = new JFrame();
DrawSemaphore panel = new DrawSemaphore();
Semaphore semaphore = new Semaphore();
semaphore.addObserver(panel);
JButton button = new JButton("Placebo");
button.setLocation(20, 200);
button.addActionListener(new ButtonEventHandler(semaphore));
panel.add(button);
window.setSize(60, 250);
window.add(panel);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}