title: JTree not displaying added nodes
body: <p>I'm trying to create my first <code>JTree</code>, but when I try to add my nodes to the tree, the changes aren't taking effect and all that's displayed is a tree with some default nodes in it (colors, sports, food).</p>
  
  <p>My main panel code in which the tree resides:</p>
  
  <pre><code>import javax.swing.JFrame;
  import javax.swing.JPanel;
  import javax.swing.UIManager;
  public class Scenario1Panel extends JPanel
  {
  
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  public Scenario1Tree scenario1Tree;
  
  public Scenario1Panel()
  {
      scenario1Tree = new Scenario1Tree();
      add(scenario1Tree);
  }
  public static void main(String args[]) 
  {
      try
      {
          String lookAndFeel = UIManager.getSystemLookAndFeelClassName();
          System.out.println(lookAndFeel);
          UIManager.setLookAndFeel(lookAndFeel);
      }
      catch(Exception e)
      {
          System.out.println("couldn't get that LookAndFeel");
      }
  
      Scenario1Panel mgr = new Scenario1Panel();
  
      JFrame frame = new JFrame();
  
      frame.add(mgr);
      frame.pack();
      frame.setVisible(true);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>My tree code is:</p>
  
  <pre><code>import javax.swing.JScrollPane;
  import javax.swing.JTree;
  import javax.swing.UIManager;
  import javax.swing.tree.DefaultMutableTreeNode;
  import javax.swing.tree.TreeSelectionModel;
  public class Scenario1Tree extends JTree
  {
  /**
   * 
   */
  private static final long serialVersionUID = 1L;
  
  private JTree tree;
  
  public Scenario1Tree()
  {
      DefaultMutableTreeNode top = new DefaultMutableTreeNode("Scenario1");
      createNodes(top);
      tree = new JTree(top);
  
      //Create a tree that allows one selection at a time.
      tree.getSelectionModel().setSelectionMode
          (TreeSelectionModel.SINGLE_TREE_SELECTION);
  
      //Create the scroll pane and add the tree to it. 
      JScrollPane treeView = new JScrollPane(tree);
  
  
  }
  
  private void createNodes(DefaultMutableTreeNode top) {
      DefaultMutableTreeNode loginUser1 = null;
      DefaultMutableTreeNode addNewUsers = null;
      DefaultMutableTreeNode addNewUsersBreakout = null;
  
      loginUser1 = new DefaultMutableTreeNode("Login User 1");
      top.add(logintUser1);
  
      addNewUsers = new DefaultMutableTreeNode("Add New Users");
      top.add(addNewUsers);
  
      addNewUsersBreakout = new DefaultMutableTreeNode("Add User2");
      addNewUsers.add(addNewUsersBreakout );
      addNewUsersBreakout = new DefaultMutableTreeNode("Add User3");
      addNewUsers.add(addNewUsersBreakout );
      addNewUsersBreakout = new DefaultMutableTreeNode("Add User4");
      addNewUsers.add(addNewUsersBreakout );
      addNewUsersBreakout = new DefaultMutableTreeNode("Add User5");
      addNewUsers.add(addNewUsersBreakout );
  
  }
  
  public static void main(String args[]) 
  {
      try
      {
          String lookAndFeel = UIManager.getSystemLookAndFeelClassName();
          System.out.println(lookAndFeel);
          UIManager.setLookAndFeel(lookAndFeel);
      }
      catch(Exception e)
      {
          System.out.println("couldn't get that LookAndFeel");
      }
  
      Scenario1Tree tree = new Scenario1Tree();
  
      JFrame frame = new JFrame();
  
      frame.add(tree);
      frame.pack();
      frame.setVisible(true);
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Could someone please explain what I'm doing wrong? </p>