From: Mateusz Warowny Date: Fri, 25 Mar 2022 17:56:37 +0000 (+0100) Subject: JAL-3878 Wrap infoPanel updates with SwingUtilities.invokeLater X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7ad4c424aacc47e4224fdbe57bf593afb55aa0bd;p=jalview.git JAL-3878 Wrap infoPanel updates with SwingUtilities.invokeLater --- 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,