You could just add 1 to an integer variable every time the mousePressed method is called.