This is really not a good idea. You tie up a thread running as fast as it possibly can, triggering repaints at an arbitrary but very high rate. It's going to burn all the CPU it can, and will run at completely different speeds on different machines.
Here's the recommended strategy for running animated games in Swing:
Use a javax.swing.Timer to call an update routine a some suitable rate (eg every 50 mSec). In that routine update all the variables associated with the sprite's position/velocity/collisions etc. After updating all the variable call repaint();
In paintComponent re-draw everything according to their current variables. Do not update those variables in paintComponent because you have no control of exactly when or how often it will be called.