title: Can we create an empty node(Directory) below the root node
body: <p>Can we create an empty directy under the root node using dynamic JTree.
  Eg:
     <img src="https://i.stack.imgur.com/S43E9.png" alt="enter image description here"></p>
  
  <p>Am tyring to create a jtree like this </p>
  
  <pre><code>public void actionPerformed(ActionEvent e) {
            String command = e.getActionCommand();
          if (ADD_COMMAND.equals(command)) {
              //Add button clicked
              System.out.println("BUTTON CLICKED ");
                DefaultMutableTreeNode p3,p4;
  
                p3=treePanel.addObject("New Node " + newNodeSuffix++);
                treePanel.addObject(p3, "newDir",false);
  
          }
  
      }
      public void populateTree(DynamicTree treePanel) {
          String p1Name = new String("Parent 1");
          String p2Name = new String("Parent 2");
          String c1Name = new String("Child 1");
          String c2Name = new String("Child 2");
  
          DefaultMutableTreeNode p1, p2;
  
          p1 = treePanel.addObject(null, p1Name);
          p2 = treePanel.addObject(null, p2Name);
  
          treePanel.addObject(p1, c1Name);
          treePanel.addObject(p1, c2Name);
  
          treePanel.addObject(p2, c1Name);
          treePanel.addObject(p2, c2Name);
      }   
  </code></pre>
  
  <p>On the button click event i cannot make directory without doing like this
   **DefaultMutableTreeNode p3,p4;</p>
  
  <pre><code>              p3=treePanel.addObject("New Node " + newNodeSuffix++);
                treePanel.addObject(p3, "newDir",false);**
  </code></pre>
  
  <p>As a result i got directory contain a file 
  <img src="https://i.stack.imgur.com/HeBRg.png" alt="enter image description here"></p>
  
  <p>i want to avoid the newDir only empty directory is needed
  please help me..........</p>
  
  <p>Any help is appreciable.......</p>
  
  <p>Thank you very much.</p>