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 TreeSelectionHandler and mouseovers 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 "TreeSelectionHandler and mouseovers" Watch "TreeSelectionHandler and mouseovers" New topic
Author

TreeSelectionHandler and mouseovers

Thomas Todaro
Greenhorn

Joined: Feb 02, 2012
Posts: 3
TreeSelectionHandler's valueChanged event is being fired whenever I move the mouse over a node. That's a problem. I have some drag-and-drop logic, and when I drag something from a higher node to a lower node, the event is being fired whenever I pass over the in-between nodes on the way to the final drop location. My program has some code for validating the drop location, but I don't want that code to run simply because I moused over a node.

I thought about writing my own MouseListener, but there's no guarantee that MouseEvent will be fired before TreeSelectionEvent.

How do I get TreeSelectionHandler to respond to an actual mouse click, rather than the "mouse entered" event?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: TreeSelectionHandler and mouseovers
 
Similar Threads
Drag and Drop problem
making own InputStreamReader()
component communication
JTree Selection Customization
Applet - Drag and Drop