Create ball that will stop when you click

i added void mousePressed