Skip to content

Commit

Permalink
added JPanel as a parent for JTree (and JScrollPane)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnet committed Mar 9, 2017
1 parent df2356b commit 723a62c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/burp/JsonJTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

public class JsonJTree extends MouseAdapter implements IMessageEditorTab, ClipboardOwner
{
private final JPanel panel = new JPanel(new BorderLayout());
private final DefaultMutableTreeNode root = new DefaultMutableTreeNode();
private final JTree tree = new JTree(root);
private final DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
Expand All @@ -29,6 +30,7 @@ public class JsonJTree extends MouseAdapter implements IMessageEditorTab, Clipbo
tree.addMouseListener(this);
this.callbacks = callbacks;
this.helpers = callbacks.getHelpers();
panel.add(new JScrollPane(tree), BorderLayout.CENTER);
}

@Override public void mousePressed (MouseEvent e) { if (e.isPopupTrigger()) doPop(e); }
Expand Down Expand Up @@ -258,7 +260,7 @@ private void expandAllNodes(JTree tree, int startingIndex, int rowCount){
}

public String getTabCaption() { return "JSON JTree"; }
public Component getUiComponent() { return new JScrollPane(tree); }
public Component getUiComponent() { return panel; }
public byte[] getMessage() { return content; }
public boolean isModified() { return false; }
public byte[] getSelectedData() { return null; }
Expand Down

0 comments on commit 723a62c

Please sign in to comment.