1
How can I check which items are selected from a checkboxTree
?
I have already searched and I know that this code returns the last selected:
DefaultMutableTreeNode node = (DefaultMutableTreeNode) checkboxTree1.getLastSelectedPathComponent();
Is there any way to know the nodes names of the selected checkboxes?
In this case something that returns me "Colors, blue , red".
When referring to all selected paths, you are referring to the selected items ?
– Hugo Machado
Path implies everything (from the root). For example, the path of "blue" would be
JTree -> colors -> blue
, thelastPathComponent
that way would beblue
.– Anthony Accioly