Skip to content

Commit 0d5d50f

Browse files
authored
Merge pull request #30 from acardona/file-system-tree
FileSystemTree: run UI updates in the event dispatch thread
2 parents 1ea839f + 3202b22 commit 0d5d50f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/main/java/org/scijava/ui/swing/script/FileSystemTree.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,14 @@ public void run() {
507507
if (null != node) nodes.add(node);
508508
}
509509

510-
for (final Node node : nodes) {
511-
node.updateChildrenList(FileSystemTree.this.getModel());
512-
FileSystemTree.this.expandPath(new TreePath(node.getPath()));
513-
}
510+
SwingUtilities.invokeLater(new Runnable() {
511+
public void run() {
512+
for (final Node node : nodes) {
513+
node.updateChildrenList(FileSystemTree.this.getModel());
514+
FileSystemTree.this.expandPath(new TreePath(node.getPath()));
515+
}
516+
}
517+
});
514518

515519
boolean valid = key.reset();
516520
if (!valid) {

0 commit comments

Comments
 (0)