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
[ August 21, 2006: Message edited by: Dave Robbins ] [ August 21, 2006: Message edited by: Dave Robbins ]
I'm not sure......e.rejectDrop() "should" handle this and I see that it is in the code. Have you tried debugging and making sure that the drop is being rejected?
Joined: Aug 17, 2006
sorry, I just remembered your debugging comment ...if you dont want to debug, you can add a System.out.println("Drop Rejected") after the line of the code that rejects an invalid drop.
Joined: Sep 16, 2003
thanks for the reply I seem to be getting inconsistent results sometimes it works sometimes it doesn't are you saying that e.rejectDrop() should notify both the drag source and the drop target that the action has been canceled? that looks like the way it works but I'm having trouble and I don't want to guess how things work I run their example code and it works flawlessly BTW, I am using a debugger, it's just that some of those methods like dragover get called repeatedly so you can't stop in those