Created
February 23, 2012 00:22
-
-
Save Seich/1888634 to your computer and use it in GitHub Desktop.
Adding Nodes to Jtree
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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