MAJ pour quitter le programme

This commit is contained in:
pablo rodriguez 2022-06-15 08:03:17 +02:00
parent 074c8fe6ec
commit 1d77351631
82 changed files with 44 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -94,7 +94,7 @@ public class create extends JFrame {
setIconImage(img.getImage());
setLocationRelativeTo( null );
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
// Construction et injection de la barre de menu
setJMenuBar( this.createMenuBar() );
@ -143,6 +143,9 @@ public class create extends JFrame {
*/
private void ListenerAction() {
/**
* Selection d'un node dans le JTree.
*/
tree.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
@ -154,6 +157,21 @@ public class create extends JFrame {
}
}
});
/**
* Fermeture de la fenêtre.
*/
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
dispose();
};
}
});
}
@ -904,15 +922,9 @@ public class create extends JFrame {
}
@Override public void actionPerformed( ActionEvent e ) {
int a = JOptionPane.showConfirmDialog(null,"Voulez-vous quitter l'application?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION);
if(a == JOptionPane.YES_NO_OPTION) {
System.out.println( "Le choix : " + a);
System.out.println( "Exit" + e.getSource().toString());
create.this.dispose();
}
if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
dispose();
}
}
};

View File

@ -80,7 +80,7 @@ public class evaluate extends JFrame {
this.setIconImage(img.getImage());
setTitle(commandes.Titre + " " + commandes.version + " " + commandes.branch);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setBounds(100, 100, 980, 700);
int screenWidth = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getWidth();
int screenHeight = (int) java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds().getHeight();
@ -254,6 +254,10 @@ public class evaluate extends JFrame {
this.setExtendedState(MAXIMIZED_BOTH);
ListenerAction();
refreshLabel();
setVisible(true);
// Pro();
@ -261,6 +265,20 @@ public class evaluate extends JFrame {
}
private void ListenerAction() {
/*Some piece of code*/
addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(java.awt.event.WindowEvent windowEvent) {
if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
dispose();
}
}
});
}
private void createMenu() {
@ -807,15 +825,9 @@ public class evaluate extends JFrame {
}
@Override public void actionPerformed( ActionEvent e ) {
int a = JOptionPane.showConfirmDialog(null,"Voulez-vous quitter l'application?", "Sélectionner un choix", JOptionPane.YES_NO_OPTION);
if(a == JOptionPane.YES_NO_OPTION) {
System.out.println( "Le choix : " + a);
System.out.println( "Exit" + e.getSource().toString());
dispose();
}
if(JOptionPane.showConfirmDialog(null,"Voulez-vous quitter analyseWriter?", "Quitter", JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE)==JOptionPane.YES_OPTION) {
dispose();
}
}
};