SAE21_2021/SaveAndCloseListener.java

40 lines
801 B
Java
Raw Normal View History

2022-05-24 22:57:12 +02:00
import java.awt.event.*;
public class SaveAndCloseListener implements WindowListener{
private Grille grille;
public SaveAndCloseListener(Grille grille){
this.grille=grille;
}
@Override
public void windowOpened(WindowEvent e) {
}
@Override
public void windowClosing(WindowEvent e) {
SaveManager saveManager = new SaveManager();
saveManager.save(this.grille, "Save.txt");
}
@Override
public void windowClosed(WindowEvent e) {
}
@Override
public void windowIconified(WindowEvent e) {
}
@Override
public void windowDeiconified(WindowEvent e) {
}
@Override
public void windowActivated(WindowEvent e) {
}
@Override
public void windowDeactivated(WindowEvent e) {
}
}