import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Attente extends JComponent implements WindowListener { @Override protected void paintComponent(Graphics pinceau) { Graphics secondPinceau = pinceau.create(); if (this.isOpaque()) { secondPinceau.setColor(Color.GREEN); secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight()); } } void windowActivated(WindowEvent evenement) // premier plan { } void windowClosed(WindowEvent evenement); // après fermeture void windowClosing(WindowEvent evenement); // avant fermeture void windowDeactivated(WindowEvent evenement); // arrière-plan void windowDeiconified(WindowEvent evenement); // restauration void windowIconified(WindowEvent evenement); // minimisation void windowOpened(WindowEvent evenement); }