Files
DEV/DEV3.1/TP03/01_Boutons/WindowControler.java

50 lines
861 B
Java
Raw Normal View History

2025-09-04 15:36:55 +02:00
import java.awt.*;
import javax.swing.*;
import java.awt.event.WindowListener;
import java.awt.event.WindowEvent;
public class WindowControler implements WindowListener {
private Fenetre fenetre;
public WindowControler(Fenetre fenetre) {
this.fenetre = fenetre;
}
public void windowActivated(WindowEvent evenement) {
}
public void windowClosed(WindowEvent evenement) {
}
public void windowClosing(WindowEvent evenement) {
int resultat = JOptionPane.showConfirmDialog(fenetre, null);
if (resultat == JOptionPane.YES_OPTION) {
fenetre.dispose();
}
} // avant fermeture
public void windowDeactivated(WindowEvent evenement) {
}
public void windowDeiconified(WindowEvent evenement) {
}
public void windowIconified(WindowEvent evenement) {
}
public void windowOpened(WindowEvent evenement) {
}
}