This commit is contained in:
2023-04-04 14:03:16 +02:00
parent 7021891e9c
commit e32d4de827
111 changed files with 1928 additions and 6 deletions

Binary file not shown.

View File

@@ -0,0 +1,21 @@
import java.awt.*;
import javax.swing.*;
public class Fermeture{
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(800, 800);
Oui yeet = new Oui();
while(yeet.checkVrai()!= true){
fenetre.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
fenetre.setVisible(true);
}
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.addWindowListener(yeet);
fenetre.setVisible(true);
}
}

Binary file not shown.

View File

@@ -0,0 +1,28 @@
import java.awt.event.*;
import javax.swing.*;
public class Oui implements WindowListener{
private int a;
public Oui(){
super();
this.a=0;
}
public void windowActivated(WindowEvent evenement){} // premier plan
public void windowClosed(WindowEvent evenement){} // après fermeture
public void windowClosing(WindowEvent evenement){} // avant fermeture
public void windowDeactivated(WindowEvent evenement){} // arrière-plan
public void windowDeiconified(WindowEvent evenement){} // restauration
public void windowOpened(WindowEvent evenement){}
public void windowIconified(WindowEvent e){
this.a=1;
}
public boolean checkVrai(){
if (this.a == 1){
return true;
}
else{
return false;
}
}
}