From 7ad4c424aacc47e4224fdbe57bf593afb55aa0bd Mon Sep 17 00:00:00 2001 From: Mateusz Warowny Date: Fri, 25 Mar 2022 18:56:37 +0100 Subject: [PATCH] JAL-3878 Wrap infoPanel updates with SwingUtilities.invokeLater --- src/jalview/ws2/gui/AlignmentServiceGuiHandler.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/jalview/ws2/gui/AlignmentServiceGuiHandler.java b/src/jalview/ws2/gui/AlignmentServiceGuiHandler.java index 2540dd1..61673f9 100644 --- a/src/jalview/ws2/gui/AlignmentServiceGuiHandler.java +++ b/src/jalview/ws2/gui/AlignmentServiceGuiHandler.java @@ -11,6 +11,7 @@ import java.util.LinkedList; import java.util.List; import javax.swing.JInternalFrame; +import javax.swing.SwingUtilities; import jalview.bin.Cache; import jalview.datamodel.Alignment; @@ -134,9 +135,10 @@ class AlignmentServiceGuiHandler @Override public void taskCompleted(TaskI source, AlignmentResult result) { + SwingUtilities.invokeLater(() -> infoPanel.removeProgressBar(jobs[0].getInternalId())); if (result == null) { - infoPanel.setFinishedNoResults(); + SwingUtilities.invokeLater(infoPanel::setFinishedNoResults); return; } infoPanel.showResultsNewFrame.addActionListener(evt -> { @@ -148,7 +150,7 @@ class AlignmentServiceGuiHandler displayResultsNewFrame(alnCpy, result.getAlignmentOrders(), result.getHiddenColumns()); }); - infoPanel.setResultsReady(); + SwingUtilities.invokeLater(infoPanel::setResultsReady); } private void displayResultsNewFrame(Alignment aln, -- 1.7.10.2