Do you have any other symptoms such as tenderness or warmth of the area. Is the swelling behind, to the side or in front of the knee?
Are you taking any medications?
Do you have any medical conditions?
Thank you for that extra detail. If there is tenderness in that area then it is possible that you injured yourself, and didn't realize. However, you may have phlebitis, which is an inflammation of a superficial vein in your leg, and which presents with these symptoms, too. In the meantime, you can take an anti-inflammatory medication such as ibuprophen, to reduce pain and inflammation, keep your leg elevated, don't sit for long periods of time with your leg still.
If the pain worsens, or area becomes swollen, you will have to make an appointment with your doctor for evaluation and medication.
I hope you start to feel better!