Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Disable double-click mouse event for a JTree?

 
david zhang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi-
You can use JTree.setToggleClickCount(int) and set it to a number higher than two.
Kyle
 
david zhang
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kyle,
That works for me. Thank you so much.
David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic