Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

JtreeTable does not return complete selection path

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

I am new to java working on JtableTree downloaded from I want to select / display the complete path (for example:"home/user/Jtree/tree.xml") when selecting a leaf node of JTreeTable. In source code of JTreeTable, in JTreeTable class they have implemented
ListSelectionListener for both table and tree. I have modified the code implemented both ListSelectionSelectionListenor and TreeSelectionListenor implemented the method for TreeSelectionevent like this:

( code snippet from class after modificaion )

class ListSelectionHandler implements ListSelectionListener, TreeSelectionListener{
public void valueChanged(ListSelectionEvent e) {
System.out.println("List selection changed listener");


public void valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) e
if(node.isLeaf()) {
System.out.println("You selected " + node);

But when we select a node(non leaf/ or leaf node) TreeSelectionEvent never get control.

Is there any other way to select/ get the complete path of selected non leaf node ?

I have also tried to add mouse listener to tree and get selected path on double click of non leaf node. How we can add the mouse listener to JtableTree to get the selected node path ?
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic