code: public static Object getUserObjectFromTreeNode(Object nodeObject)
      {
          if (nodeObject == null)
          {
              return null;
          }
          if (nodeObject instanceof DefaultMutableTreeNode)
          {
              DefaultMutableTreeNode node = 
                  (DefaultMutableTreeNode)nodeObject;
              Object userObject = node.getUserObject();
              return userObject;
          }
          return null;
      }
docs: Returns the user object from the given tree node. If the given node
  object is <code>null</code> or not a DefaultMutableTreeNode,
  then <code>null</code> is returned.
  
  @param nodeObject The node object
  @return The user object