How to get on with luxor.swing.tree?

"Rekouts Maria" <[email protected]>
Newsgroups gmane.comp.java.luxor-xul.user
Message-ID <004101c2d6ce$d813ab90$a220d0c3@Masha>
  Hi, 

I was glad to find Luxor Swing libraries! Namely, I was interested in XmlTreeModel to use in my tool GUI. 
I have never used Luxor before, so I'm sorry for stupid questions in advance:) 

In my tool I'd like to have a swing tree constructed over a concret XML document (not DTD) 
then I use TreeSelectionListener from javax.swing.tree 
and have a java.lang.ClassCastException 

that's what I do in my code: 
// this is just for converting org.w3c.dom.Document 
// into org.jdom.Document for use in XmlTreeModel 
// (maybe it's not right? help!) 

org.jdom.input.DOMBuilder domBuilder = new org.jdom.input.DOMBuilder(); 

org.jdom.Document docJdom = domBuilder.build(doc); 

XmlTreeModel treeModel = new XmlTreeModel(docJdom); 

//Create a tree that allows one selection at a time. 
tree = new JTree(treeModel); 
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); 

//Listen for when the selection changes. 
tree.addTreeSelectionListener(new TreeSelectionListener() { 
                       public void valueChanged(TreeSelectionEvent e) { 
                               DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); 

                                       if (node == null) return; 

                                       Object nodeInfo = node.getUserObject(); 
                                        if (node.isLeaf()) { 
                                        System.out.println(" Leaf!! "); 
                                                                                                       }   
                        } 
   }); 

so I have an Exception at line with tree.getLastSelectedPathComponent(); 

What should I do?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.