Hello All,
I'm trying to implement DnD in a JTree
I have a problem when the user drags a node to a place it's not allowed to be dropped
The action doesn't seem to be ended properly
here's example code for discussion
http://www.java2s.com/Code/Java/Swing-JFC/DnDdraganddropJTreecode.htm So, there's a drag source and a drop target
when you begin the drag the function dragGestureRecognized in the source get's called, this get's the ball rolling
when you drop the node, the function drop in the target get's called and if the target is invalid the target rejects the action
but in my code the source doesn't seem to get the message that the action has been terminated
if I try to drag another node the dragGestureRecognized function throws an exception that a drag operation is already in progress
how is this supposed to work?
I see the dragDropEnd function in the source, but it just seems to remove the old node if it's a MOVE operation, it seems like it should also handle the situation where the action get's canceled
Any Pointers??
Maybe just a little explaination of the flow of things
It's hard to trace this down in a debugger because so many events are being fired
TIA
Dave
[ August 21, 2006: Message edited by: Dave Robbins ]
[ August 21, 2006: Message edited by: Dave Robbins ]