This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Disable double-click mouse event for a JTree? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Disable double-click mouse event for a JTree?" Watch "Disable double-click mouse event for a JTree?" New topic
Author

Disable double-click mouse event for a JTree?

david zhang
Greenhorn

Joined: Oct 12, 2003
Posts: 27
I have noticed that if I double-click a JTree node, there
are two mouse events generated in sequence: one is one-click mouse event
and the other one is a double-click mouse event. at the same
time, the clicked node either collapses and expands.
I want the clicked node have no reaction to a double-click on
it. How can I do it?
Thanks very much,
David
kyle amburn
Ranch Hand

Joined: Jul 29, 2001
Posts: 64
Hi-
You can use JTree.setToggleClickCount(int) and set it to a number higher than two.
Kyle
david zhang
Greenhorn

Joined: Oct 12, 2003
Posts: 27
Kyle,
That works for me. Thank you so much.
David
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disable double-click mouse event for a JTree?
 
Similar Threads
JTree
JTree expand node and highlight
JTree
swing editing JTree nodes
JTree Selection Customization