APL/APL2.1/TP8/Attente/Attente.java

35 lines
972 B
Java

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Attente implements WindowListener{
private JFrame vue;
private Disque dessin = new Disque();
public Attente(JFrame v){
this.vue = v;
}
public void windowActivated(WindowEvent e) // premier plan
{
dessin.Change(true);
vue.repaint();
this.vue.add(dessin,BorderLayout.CENTER);
System.out.println("ok act");
}
public void windowDeactivated(WindowEvent e) // arrière-plan
{
dessin.Change(false);
vue.repaint();
this.vue.add(dessin,BorderLayout.CENTER);
System.out.println("ok deact");
}
public void windowClosed(WindowEvent evenement){} // après fermeture
public void windowClosing(WindowEvent evenement){} // avant fermeture
public void windowDeiconified(WindowEvent evenement){} // restauration
public void windowIconified(WindowEvent evenement){} // minimisation
public void windowOpened(WindowEvent evenement){} // après ouverture
}