import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseListener;
import java.awt.event.MouseEvent;

public class Controlleur implements MouseListener {

	private JLabel[] img;
	private Fenetre fenetre;
	private int actuel;
	private CardLayout layout;

	public Controlleur(JLabel[] img, Fenetre fenetre, CardLayout layout) {
		this.img = img;
		this.fenetre = fenetre;
		this.actuel = 0;
		this.layout = layout;
	}

	public void mouseClicked(MouseEvent evenement) {
		if (evenement.getX() < this.fenetre.getWidth()/2) {
			this.layout.previous(this.fenetre.getContentPane());
		}
		else {
			this.layout.next(this.fenetre.getContentPane());
		}
		this.layout.show(this.fenetre.getContentPane(), "wow");
	}        // un bouton cliqué


	public void mouseEntered(MouseEvent evenement) {}          // debut du survol
	public void mouseExited(MouseEvent evenement) {}             // fin du survol
	public void mousePressed(MouseEvent evenement) {}           // un bouton appuyé
	public void mouseReleased(MouseEvent evenement) {}          // un bouton relâché
}