equals() failing in userObject of TreeNode
I'm not exactly sure how to ask this question, since my code is very long and has many pieces and I have no idea where the problem is.
I have a drag and drop implementation that usually works fine (I am using a JTree);
However, with this particular program it is doing the following:
When I drag a node to itself, it is not recognizing it as the same node.
I did some testing and it seems like it is the userObjects of the target drop and the source (which are the same node) are being seen as different. This doesn't make sense because this single node has one single userObject not two different ones. I checked for the hashcodes of the userobjects and they are different.
I am using a drag and drop implementation from another forum I don't know if I should post it here, since it is too long and I'm not sure the problem lies there, so perhaps something is wrong with my program. I don't know where to start though?
My program saves the data of a JTree into a text file and then loads it. The userObject is a custom made one with two strings in it. I attempted trying to override the equals() method but I'm not sure I was successful with that, especially since I don't know much about hashCodes etc.
Any pointers on where I should look to solve this problem would be appreciated.
PS