mirror of
https://github.com/LucasVbr/LecteurPdfDoubleAffichage.git
synced 2026-12-05 18:30:49 +00:00
popup faites
This commit is contained in:
@@ -9,6 +9,8 @@ package lecteur_pdf.menuBar.menuItems;
|
||||
import lecteur_pdf.GestionPdf;
|
||||
import lecteur_pdf.IhmPdf;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
/**
|
||||
@@ -31,9 +33,24 @@ public class FermerFichier extends MenuItem {
|
||||
|
||||
/* Action du bouton */
|
||||
addActionListener(e -> {
|
||||
parent.getPdfPanel().dechargerPdf();
|
||||
parent.setTitle(GestionPdf.TITRE_APPLICATION);
|
||||
parent.pack();
|
||||
JDialog jd = new JDialog();
|
||||
jd.setLayout(new FlowLayout());
|
||||
jd.setBounds(500,300,400,100);
|
||||
JLabel jlabel = new JLabel("etes vous sûr de vouloir fermer ? ");
|
||||
JButton oui = new JButton("oui");
|
||||
oui.addActionListener(m -> {
|
||||
parent.getPdfPanel().dechargerPdf();
|
||||
parent.setTitle(GestionPdf.TITRE_APPLICATION);
|
||||
parent.pack();
|
||||
jd.setVisible(false);
|
||||
});
|
||||
JButton non = new JButton("non");
|
||||
non.addActionListener(n -> jd.setVisible(false));
|
||||
jd.add(jlabel);
|
||||
jd.add(oui);
|
||||
jd.add(non);
|
||||
jd.setVisible(true);
|
||||
|
||||
});
|
||||
|
||||
/* TODO Définition du raccourcis clavier a modifier */
|
||||
|
||||
Reference in New Issue
Block a user