From 58e8295a2a26cc7ef4c9742729eb20ebf242b6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jindra=20Pet=F8=EDk?= Date: Fri, 19 Jul 2013 12:06:12 +0200 Subject: [PATCH] Issue #247 Project tree is not scrolled to the selected Document Class position on start --- .../jpexs/decompiler/flash/gui/abc/ABCPanel.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java index d996cf3e4..ca553f4bc 100644 --- a/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java +++ b/trunk/src/com/jpexs/decompiler/flash/gui/abc/ABCPanel.java @@ -496,11 +496,15 @@ public class ABCPanel extends JPanel implements ItemListener, ActionListener, Fr public void hilightScript(ScriptPack pack) { TagTreeModel ttm = (TagTreeModel) Main.mainFrame.tagTree.getModel(); - TreePath tp = ttm.getTagPath(pack); - if (tp == null) { - } - Main.mainFrame.tagTree.setSelectionPath(tp); - Main.mainFrame.tagTree.scrollPathToVisible(tp); + final TreePath tp = ttm.getTagPath(pack); + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + Main.mainFrame.tagTree.setSelectionPath(tp); + Main.mainFrame.tagTree.scrollPathToVisible(tp); + } + }); + } public void updateSearchPos() {