Injury to the ligament, meniscal tears, fractures, tendinitis and bursitis can cause swelling
and pain in the knee. Some degenerative diseases like osteoporosis, chondromalacia, arthritis due to rhematic fever, psoriaisis, infections etc can also cxause swelling and pain.
In your case as there is no injury, I think it could most probably be due to infection or over use of the joint. Bursitis or tendinitis could be the cause. Get an x-ray and physical examination done by your doctor.