Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mvc;
- import java.awt.BorderLayout;
- import java.awt.HeadlessException;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.swing.JButton;
- import javax.swing.JFrame;
- import javax.swing.JPanel;
- public class FeuGUI extends JFrame {
- private static final long serialVersionUID = 586870147455311879L;
- protected FeuTricolore feu;
- /**
- * Constructeur de FeuGUI
- * @param ft
- * @throws HeadlessException
- */
- public FeuGUI() {
- this(new FeuTricolore());
- }
- public FeuGUI(FeuTricolore feu) throws HeadlessException {
- super("Feux Tricolores de signalisation");
- JButton next = new JButton("Next");
- VueFeu vue = new VueFeu(feu);
- this.feu = feu;
- this.add(next, BorderLayout.SOUTH);
- next.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent arg0) {
- feu.changeColor();
- }
- });
- this.pack();
- this.setLocationRelativeTo(null);
- this.setVisible(true);
- this.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement