title: Add new node to existing node in JavaTree using Java
body: <p>I have a already created java tree. Now I want to add new node to existing node in this Java tree. This existing node can be any where in the tree.</p>
  
  <p>My tree nodes are included in a HashMap and each node have key(String) and value(Double). I know its key and value. So, how to add this node to correct existing node? </p>
  
  <pre><code>  DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(new NodeInfor(check, 0.45));  
  
              nodeReg.put(check, newNode);
              ?????.add(newNode);
  </code></pre>
  
  <p>In above code for ????? what I need to used? Existing node is I already created.But  In this point I select it randomly and I know only its key and value. </p>
  
  <p>If I want to create a separate another JavaTree after adding this new node, </p>
  
  <pre><code>                tree = new JTree(root); ------------------????
                  add(tree);
                  this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                  this.setTitle("Sub JTrees");
                  this.pack();
                  this.setVisible(true);
  </code></pre>
  
  <p>in above code,  <code>tree = new JTree(root);</code> what I need to add for <code>root</code>? </p>
  
  <p>UPDATE:
  More coding part:</p>
  
  <pre><code>        //create root
          DefaultMutableTreeNode root = new DefaultMutableTreeNode(new NodeInfor(keys.get(0), values.get(0)));
          // create the child nodes
          DefaultMutableTreeNode aNode = new DefaultMutableTreeNode(new NodeInfor(keys.get(1), values.get(1)));
          DefaultMutableTreeNode bNode = new DefaultMutableTreeNode(new NodeInfor(keys.get(2), values.get(2)));
  
             nodeReg.put(keys.get(0), root);
             nodeReg.put(keys.get(1), aNode);
             nodeReg.put(keys.get(2), bNode);
  
             root.add(aNode);
             root.add(bNode);
             -----------
             -----------
               ---------
             ---------
              tree = new JTree(root);
              add(tree);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setTitle("First JTree");
              this.pack();
              this.setVisible(true);
               ---------
               ----------
               ----------
             DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(new NodeInfor(check, 0.45));  
  
              nodeReg.put(check, newNode);
              ?????.add(newNode);-----------------?????????
  
              tree = new JTree(???????????);------------??????
              add(tree);
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setTitle("Sub JTree");
              this.pack();
              this.setVisible(true);
              }
  </code></pre>
  
  <p>I want to add new node to <code>keys.get(1), values.get(1)</code> . So how to add and display new tree again?</p>