Swing Fixes
Call on the tree update from the swing thread
This commit is contained in:
parent
0d27212f07
commit
39233ca3eb
2 changed files with 18 additions and 15 deletions
|
@ -14,14 +14,7 @@ import java.io.File;
|
|||
import java.util.Enumeration;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JCheckBox;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.JTree;
|
||||
import javax.swing.*;
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
import javax.swing.tree.TreeNode;
|
||||
import javax.swing.tree.TreePath;
|
||||
|
@ -163,7 +156,6 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
|
|||
{
|
||||
try
|
||||
{
|
||||
|
||||
//TODO refresh while preserving the opened files from before the refresh
|
||||
treeRoot.removeAllChildren();
|
||||
for (ResourceContainer container : BytecodeViewer.resourceContainers)
|
||||
|
@ -347,9 +339,14 @@ public class ResourceListPane extends TranslatedVisibleComponent implements File
|
|||
try
|
||||
{
|
||||
imp.getImporter().open(tempFile);
|
||||
try {
|
||||
updateTree();
|
||||
} catch (NullPointerException ignored) { }
|
||||
SwingUtilities.invokeLater(()->
|
||||
{
|
||||
try
|
||||
{
|
||||
updateTree();
|
||||
}
|
||||
catch (NullPointerException ignored) { }
|
||||
});
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.apache.commons.io.FilenameUtils;
|
|||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||
import the.bytecode.club.bytecodeviewer.Settings;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.io.File;
|
||||
|
||||
/***************************************************************************
|
||||
|
@ -74,9 +75,14 @@ public class ImportResource implements Runnable
|
|||
finally
|
||||
{
|
||||
BytecodeViewer.updateBusyStatus(false);
|
||||
try {
|
||||
BytecodeViewer.viewer.resourcePane.updateTree();
|
||||
} catch (NullPointerException ignored) { }
|
||||
SwingUtilities.invokeLater(()->
|
||||
{
|
||||
try
|
||||
{
|
||||
BytecodeViewer.viewer.resourcePane.updateTree();
|
||||
}
|
||||
catch (NullPointerException ignored) { }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue