From bd1c393053a1a9455792392e26a840cbd7abeafa Mon Sep 17 00:00:00 2001 From: Mikael Capelle Date: Fri, 2 Mar 2018 11:18:38 +0100 Subject: [PATCH] Fix issue with dialog not being shown up relative to the MainWindow. --- src/main/org/insa/graphics/MainWindow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/org/insa/graphics/MainWindow.java b/src/main/org/insa/graphics/MainWindow.java index 18c7d00..ec03786 100644 --- a/src/main/org/insa/graphics/MainWindow.java +++ b/src/main/org/insa/graphics/MainWindow.java @@ -185,7 +185,7 @@ public class MainWindow extends JFrame { addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { - int confirmed = JOptionPane.showConfirmDialog(null, + int confirmed = JOptionPane.showConfirmDialog(MainWindow.this, "Are you sure you want to close the application?", "Exit Confirmation", JOptionPane.YES_NO_OPTION); @@ -683,7 +683,7 @@ public class MainWindow extends JFrame { @Override public void actionPerformed(ActionEvent e) { if (currentThread.isRunning()) { - int confirmed = JOptionPane.showConfirmDialog(null, + int confirmed = JOptionPane.showConfirmDialog(MainWindow.this, "Are you sure you want to kill the running thread?", "Kill Confirmation", JOptionPane.YES_NO_OPTION); if (confirmed == JOptionPane.YES_OPTION) {