Skip to content

Commit 22b78b7

Browse files
committed
Fix progress dialog remaining on screen after load
This already happened in previous version without the recent changes. There could be a race, where raw setVisible(false) call executes before the initial invokeLater call to show it in the first place.
1 parent 8e49f0e commit 22b78b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/itextpdf/rups/model/ObjectLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ protected void done() {
153153
}
154154
try {
155155
eventListener.handleOpenDocument(this);
156-
progress.setVisible(false);
156+
SwingUtilities.invokeLater(() -> progress.setVisible(false));
157157
} catch (RuntimeException ex) {
158158
displayThrowable(ex);
159159
}
@@ -189,6 +189,6 @@ private void clearResult() {
189189
private void displayThrowable(Throwable th) {
190190
LoggerHelper.error(th.getLocalizedMessage(), th, getClass());
191191
progress.showErrorDialog(th);
192-
progress.setVisible(false);
192+
SwingUtilities.invokeLater(() -> progress.setVisible(false));
193193
}
194194
}

0 commit comments

Comments
 (0)