File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
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