BUT2/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementIngredient.java

23 lines
613 B
Java
Raw Normal View History

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
2023-12-19 19:50:02 +01:00
import java.util.Deque;
public class EvenementIngredient implements ItemListener{
2023-12-19 19:50:02 +01:00
private Deque<JCheckBox> historiqueChoix;
private JButton boutonRetour;
2023-12-19 19:50:02 +01:00
public EvenementIngredient(Deque<JCheckBox> historiqueChoix, JButton boutonRetour){
this.historiqueChoix = historiqueChoix;
this.boutonRetour = boutonRetour;
}
@Override
public void itemStateChanged(ItemEvent e){
2023-12-19 19:50:02 +01:00
JCheckBox coche = (JCheckBox) e.getSource();
this.historiqueChoix.push(coche);
this.boutonRetour.setEnabled(true);
}
}