Search code examples
javaswingxtreetable

If the user selects a row in a JTreeTable SwingX, how do I find out which node is actually selected


I am working on TreeTable in swingx library and I cant find a way how to actually get the treetable node selected on view. There is a method called getSelected, but it only gets the index from the table, I have no means to translate it into the model, plus this index depends if the node expanded or not. And in the model there are not methods to get children by the index on the table, and again the index depends if nodes are expanded or not, so I can't see no sure way to get actual selected node from the table. Did anyone have the same problem and can help??


Solution

  • Doesn't the method

    getPathForRow(...)
    

    give you what you need?