import javax.swing.*; import java.awt.*; public class Fenetre extends JFrame{ private PileIngredient historique; public Fenetre(){ super(); this.setTitle("Question1"); this.setSize(500, 300); this.setLocation(0, 0); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.historique = new PileIngredient(); this.addIngredient(); } private void addIngredient(){ JButton retour = new JButton("RETOUR"); EvenementIngredient evenementIngredient = new EvenementIngredient(this.historique, retour); Ingredient[] listeIngredient = Ingredient.values(); int nbIngredient = listeIngredient.length; Coche[] listeCoche = new Coche[nbIngredient]; int i; this.setLayout(new GridLayout(1,nbIngredient+1)); for (i=0; i