From 15e68e1829f723072283a16b29f17b76cd992ae4 Mon Sep 17 00:00:00 2001 From: Mark Benson Date: Wed, 20 Nov 2024 23:46:56 +0000 Subject: [PATCH] Update DialogCloser.java --- .../main/java/VASSAL/tools/swing/DialogCloser.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/tools/swing/DialogCloser.java b/vassal-app/src/main/java/VASSAL/tools/swing/DialogCloser.java index b7c4aa4622..8444a01fd8 100644 --- a/vassal-app/src/main/java/VASSAL/tools/swing/DialogCloser.java +++ b/vassal-app/src/main/java/VASSAL/tools/swing/DialogCloser.java @@ -34,11 +34,12 @@ public DialogCloser(JDialog dialog, int ms) { @Override public void run() { - try { - Thread.sleep(ms); - } - catch (InterruptedException e) { - throw new RuntimeException(e); + if (ms > 1) { // Zero means no sleep - refresh only + try { + Thread.sleep(ms); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } dialog.setVisible(false); dialog.dispose();