I think it is useful to make a distinction between two types of animation.
First, it is also possible to animate on an "as-needed" basis. In this case, as the mouse moves (assuming click-and-dragging a playing piece), the location of the mouse is sent to the class that controls the piece. Then a command is issued to render the screen. (This could also be done by listening to the keys, instead of the mouse, and using arrow key presses or AWSD or whatever to update the piece's location data, and again immediately followed by a render command.)
A second type is most often used in games, especially where animation needs to continue even when the User is not doing anything. With this type, there is a piece of code responsible for executing a "game loop". This is code that goes through a cycle of two things (a) calculation of new positions [aka "game state"] (b) rendering the graphics. A usual goal it to have the loop take a fixed amount of time. This can be done by triggering the cycle via a Timer (util.Timer is best, imho), or by putting in a Thread.sleep() command with an amount of time between cycles (this is more commonly done than Timer methods). Most of the animators at JGO aim for 60 fps (animation draws or frames per second), but in my experience, 30 fps is more than adequate when all you are doing is dragging playing pieces around the screen.
In this scenario, the MouseMotionListener or KeyListener again triggers the sending of location data to the class that controls the piece, but in this case it does not
trigger a render. It is the game loop code that takes whatever location is stored in the piece at the time, and uses that for the rendering. In other words, the updating of the location (via the mouse drag) and the drawing are on two separate threads. There might be a bit of "synchronization" needed to make sure the x & y get updated as a unit. [Send the location data as a Point object?]
In any case, I would suggest you first just try to write a program where you click on an empty screen and it draws a box, and if you drag from within the box, the location of the box moves, using the first method of animation. You will find the .contains() method of the Rectangle helpful. If you are able to get this to work, then the more usual method of animation will be all the easier to understand and code.
Horstmann has published sample code that does just this, as part of his "Core Java" series. Chapter 8 (in my 8th edition, has a program called "MouseTest.java" which you should be able to find online at the sample code download for this book.http://www.horstmann.com/corejava.html