R
Ramon F Herrera
I have a problem with JTrees: the user can click away
selecting a set of paths (with the usual <shift> and
<control> keys) but there is no click method that will
restore the tree to its original, pristine, unselected
state.
What I would like to implement is the familiar Mac and
Windows icon selection: when the user clicks on the
desktop all the file icons become unselected.
I figured out how to perform the actual unselection:
if (tree == leftTree && rightTree.getLastSelectedPathComponent() != null)
rightTree.setSelectionPath(null);
However, I don't know what event should trigger the above
response. The only Tree Listener seems to be 'valueChanged'
which is fired only when one of the folders is clicked.
How can I detect a click on the background of a tree??
TIA,
-Ramon F Herrera
selecting a set of paths (with the usual <shift> and
<control> keys) but there is no click method that will
restore the tree to its original, pristine, unselected
state.
What I would like to implement is the familiar Mac and
Windows icon selection: when the user clicks on the
desktop all the file icons become unselected.
I figured out how to perform the actual unselection:
if (tree == leftTree && rightTree.getLastSelectedPathComponent() != null)
rightTree.setSelectionPath(null);
However, I don't know what event should trigger the above
response. The only Tree Listener seems to be 'valueChanged'
which is fired only when one of the folders is clicked.
How can I detect a click on the background of a tree??
TIA,
-Ramon F Herrera