From 044aead799cf703fe9fc347215a9cf235fc7cf0a Mon Sep 17 00:00:00 2001 From: Niki Roo Date: Mon, 4 May 2020 19:20:05 +0200 Subject: [PATCH] WaitingDialog: do not allow close and dispose when needed --- ui/WaitingDialog.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/WaitingDialog.java b/ui/WaitingDialog.java index 15dca6c..7df5a8b 100644 --- a/ui/WaitingDialog.java +++ b/ui/WaitingDialog.java @@ -93,6 +93,8 @@ public class WaitingDialog extends JDialog { String waitingText) { super(parent); + this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); + this.pg = pg; if (waitingText != null) { @@ -154,11 +156,14 @@ public class WaitingDialog extends JDialog { /** * Notify this {@link WaitingDialog} that the job is done, and dismiss it if * it was already showing on screen (or never show it if it was not). + *

+ * Will also dispose the {@link WaitingDialog}. */ public void dismiss() { synchronized (waitLock) { if (waitScreen) { setVisible(false); + dispose(); } waitScreen = true; } -- 2.27.0