Welcome to the Ranch!
I've modified your post to
UseCodeTags, and I've also added some indentation. It would be great if you could do that yourself from now on.
As I was adding the indentation I got a good look at your code. I see three problems:
3) You override
paintComponent, but you a) make it public where protected will do, and b) you're not calling
super.paintComponent(g); as the first statement.
2) You're catching an exception on line 45 without doing anything. This isn't a good habit because you will never notice if anything goes wrong; the least
you should do is print the stack trace.
1) The most important one of all: you're sleeping on the Event Dispatcher
Thread. I suggest you first read
Concurrency in Swing, and then switch to using a javax.swing.Timer to do the work in your
animate() method.