Skip to content

Instantly share code, notes, and snippets.

@Seich
Created February 23, 2012 00:22
Show Gist options
  • Save Seich/1888634 to your computer and use it in GitHub Desktop.
Save Seich/1888634 to your computer and use it in GitHub Desktop.
Adding Nodes to Jtree
DefaultTreeModel model = (DefaultTreeModel)tree.getModel();
DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot();
DefaultMutableTreeNode c1 = new DefaultMutableTreeNode("Cruce #1");
c1.add(new DefaultMutableTreeNode("Child 1"));
root.add(c1);
model.reload();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment