How to unSelect a JTree??
From: Ramon F Herrera (ramon_at_conexus.net)
Date: 07/23/04
- Next message: Bulent Erdemir: "What is the maximum number of selectable channels can a Selector handle ?"
- Previous message: Andrew Thompson: "Re: Java HTML Parser"
- Next in thread: Andrew Thompson: "Re: How to unSelect a JTree??"
- Reply: Andrew Thompson: "Re: How to unSelect a JTree??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 23 Jul 2004 02:17:50 -0700
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
- Next message: Bulent Erdemir: "What is the maximum number of selectable channels can a Selector handle ?"
- Previous message: Andrew Thompson: "Re: Java HTML Parser"
- Next in thread: Andrew Thompson: "Re: How to unSelect a JTree??"
- Reply: Andrew Thompson: "Re: How to unSelect a JTree??"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|