Fix window closing on "cancel" and "no"

This commit is contained in:
Lucas Alber
2019-02-27 15:38:57 +01:00
parent 4ea716be6c
commit 12900e664f

View File

@@ -44,7 +44,7 @@ public class Main {
frame.add(mainPanel);
frame.pack();
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
frame.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e) {
if (JOptionPane.showConfirmDialog(frame, "Abort and Close?") == 0) {