Why do I have pain under my kneecap when I play ball?

Your age? You don't mention your age, but assuming you're young, you may have a condition called "chondromalacia patella". Here is an explanation and some good exercises for it: http://www.Sportmed.Com/pdf/chondromalacia.Pdf if the diagnosis seems incorrect, you should check with your family doc.