I\'m trying to move a JButton to the location of another one but the button I want to move moves to a wrong point. My idea is that this happens because I use multiple JPanels. I
Maybe use mousePressed()
,when you move the card,you press it until the target.And in the process, you get the information about JButton.getLocation()
by the event,and than you need to solve the collision problem between two cards.So it's good!Of course, this is my advice ,you should have better idea!