From b3f5db6032f9fcf90d2ca999caee80531fe2c639 Mon Sep 17 00:00:00 2001 From: "honfika@gmail.com" Date: Mon, 22 Jun 2015 15:17:19 +0200 Subject: [PATCH] Scroll the selected node in tagtree to visible (bacause when detail panel is shown, sometimes the selected node can be out of the visible area) --- .../jpexs/decompiler/flash/gui/MainPanel.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/com/jpexs/decompiler/flash/gui/MainPanel.java b/src/com/jpexs/decompiler/flash/gui/MainPanel.java index 583d3b2c3..85bbbce83 100644 --- a/src/com/jpexs/decompiler/flash/gui/MainPanel.java +++ b/src/com/jpexs/decompiler/flash/gui/MainPanel.java @@ -2635,9 +2635,25 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } else { if (!detailPanel.isVisible()) { detailPanel.setVisible(true); + + new Thread() { + + @Override + public void run() { + try { + Thread.sleep(10); + } catch (InterruptedException ex) { + logger.log(Level.SEVERE, null, ex); + } + + View.execInEventDispatch(() -> { + tagTree.scrollPathToVisible(tagTree.getSelectionPath()); + }); + } + + }.start(); } } - } private void showCard(String card) { @@ -2829,6 +2845,7 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se } public void reload(boolean forceReload) { + tagTree.scrollPathToVisible(tagTree.getSelectionPath()); if (Configuration.dumpView.get()) { dumpViewReload(forceReload); return;