wow le tp là
This commit is contained in:
50
DEV3.1/TP03/01_Boutons/WindowControler.java
Normal file
50
DEV3.1/TP03/01_Boutons/WindowControler.java
Normal file
@@ -0,0 +1,50 @@
|
||||
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) {
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user