BUT2/DEV/DEV2.1/Controle_Machine_blanc/Q5_Fermeture/Q5Main.java~

17 lines
560 B
Java
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Q5Main{
public static void main(String[] args){
JFrame fenetre = new JFrame();
ActionFenetre fenetreDynamique = new ActionFenetre(fenetre);
JLabel message = new JLabel("Minimisez la fenêtre avant de la fermer !", JLabel.CENTER);
fenetre.setSize(500, 500);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
fenetre.add(message, BorderLayout.CENTER);
fenetre.addWindowListener(fenetreDynamique);
fenetre.setVisible(true);
}
}