Rob Camick wrote:Try the ListTransferHandler from the Drop Demo example found in the Swing tutorial.
Thanks for your help! I've taken a look at the ListTransferHandler and decided to try my luck with ReportingListTransferHandler again. I've read the Swing tutorial until "Export Methods" and supposed the error is in the exportDone method. I can reproduce the error with this little modification:
The ReportingListTransferHandler is unchanged. Start this now and try to drag "right 6" to the left list. The result is "right 6" in both lists and "right 7" deleted. I want that right 7 is not deleted. It should be where right 6 was.
I suggested that the condition if (addCount > 0) is not correct, because the author wrote:
// If we are moving items around in the same list, we
// need to adjust the indices accordingly since those
// after the insertion point have moved.
So my question is, if you agree with my suggestion: How can I identify if we are moving items around in the same list? Here is the relevant method with some comments:
I've already tried a debugger session with eclipse, and read about getDropLocation(), but until now I do not see the solution.