Basic example with comments for animation in a Java Applet.
This uses special blocks not covered in the class/textbook, the try{} and catch(){} blocks. These are all part of Exceptions, which you can read a little bit about in Chapter 5.2.
They're kind of like if(){}else(){} blocks in that they check for certain conditions before proceeding, but used more for debugging a program / properly designing it for failures.
To add this to your Eclipse, please make a new Java Project, and create 2 classes with the exact same names as the files in this repository.
Then, just go into each file in this repository, copy the code inside, and paste them into the corresponding class.