Problem with JTree DnD
I am really stuck on this and desperately need help.
I am programming Drag and Drop on a JTree using TransferHandler. One of the things my canImport method checks for is trying to drop a parent on a child (clearly a no-no). The method correctly checks for this condition and returns FALSE. The cursor shows the appropriate circle with a line thru it indicating you can't drop here.
However, if I go ahead and release the mouse anyways, for some reason it goes ahead and tries to make the transfer. It calls my exportDone method first (since that method doesn't know any better, it goes ahead and unhooks the node from the tree), and then calls my importData method. Since the node us already unhooked from the tree, I am now screwed.
What am I doing wrong? Why does the transfer ignore my canImport returning false and go ahead and try to transfer anyways?
Any help is greatly appreciated ... I am really screwed here.