Changed mouseClicked to mouseReleased. Much better click detection.