public void valueChanged(TreeSelectionEvent e) {
        DefaultMutableTreeNode node = (DefaultMutableTreeNode)
                           tree.getLastSelectedPathComponent();

        if (node == null) return;

        Object nodeInfo = node.getUserObject();
        if (node.isLeaf()) {
            BookInfo book = (BookInfo)nodeInfo;
            displayData(book.bookData);
            if (DEBUG) {
                System.out.print(book.bookData + ":  \n    ");
            }
        } else if (node.getUserObject() instanceof BookInfo == true) {
            BookInfo book = (BookInfo) node.getUserObject();
            if (book.bookURL != null)
                displayURL(book.bookURL);
            else 
                displayData(book.bookData);
        } else {
            displayData(bookData); 
        }
        if (DEBUG) {
            System.out.println(nodeInfo.toString());
        }
    }