I figured out the MouseHandler error. That was the name of the class that I was calling to decide whether or not the square was clicked. I changed it to MouseAdapter and it worked just fine now. Thanks everyone for your help.