22 lines
589 B
Java
22 lines
589 B
Java
|
import javax.swing.*;
|
||
|
import java.awt.*;
|
||
|
import java.awt.event.*;
|
||
|
|
||
|
public class EvenementIngredient implements ItemListener{
|
||
|
|
||
|
private PileIngredient historiqueChoix;
|
||
|
private JButton boutonRetour;
|
||
|
|
||
|
public EvenementIngredient(PileIngredient historiqueChoix, JButton boutonRetour){
|
||
|
this.historiqueChoix = historiqueChoix;
|
||
|
this.boutonRetour = boutonRetour;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public void itemStateChanged(ItemEvent e){
|
||
|
Coche coche = (Coche) e.getSource();
|
||
|
this.historiqueChoix.push(coche.getValeur());
|
||
|
this.boutonRetour.setEnabled(true);
|
||
|
}
|
||
|
}
|