File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "TreeSelectionHandler and mouseovers" Watch "TreeSelectionHandler and mouseovers" New topic

TreeSelectionHandler and mouseovers

Thomas Todaro

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?
I agree. Here's the link:
subject: TreeSelectionHandler and mouseovers
It's not a secret anymore!