This sounds familiar: Runners knee. The causes are your two sports, running and also jumping for Basketball. These two activities require motions which need the kneecap to perform harmoniously with the quadriceps muscle, which enables the patella tracking in the femoral grove. In short your overworking your knee functionality. If you continue without first fixing this problem it will get much worse. Take a few days out to put right the problem.
I'm suggesting the full package for recovering from runners knee.
You might not have the full symptoms yet, prevention of the problem getting worse is your best remedy.
So long as you do not over work your knee and give it time to recover, it will get better but to increase recovery speed you can:
Take a rest from running and basketball, you can return to these in time. For around 3 days (more if you prefer) use an ice pack every 4 hours, this will bring down any swelling and ease pain. Support your knee, get a quality elasticated bandage, a knee sleeve or patella straps. When you are laying down or sitting elevate your leg on a cushion (or something similar), ask your doctor if you need an anti inflammatory drug such as ibuprofen?
You need to strengthen your quadriceps muscle, this is important for runners to prevent runners knee in the future, gently introduce strengthening and stretching exercises. Use arch supports in your sports shoes, choose a pair with comfortable built in supports.
If you follow this recovery routine your knee will get better, be patient, fix yourself and return stronger and ready for running. Don't go back to challenging running until you can comfortably straighten and bend your knee and it feels equally strong in comparison to your other knee.
If by the 4th day you are sure that your knee is not recovering, you must get it checked by a doctor to see if you need further medical help.