It sounds like you may have experienced a patellofemoral joint dislocation. The patellofemoral joint is formed by the patella (kneecap) as it glides up and down over the front of the knee. Since the injury occurred suddenly and without previous injury, we refer to this as an acute episode. Symptoms of swelling, bleeding under the patella or bruising around the patella, and tenderness along the edge are signs that a dislocation occurred.
Treatment for acute patellofemoral joint trauma is usually with a period of immobilization in a cast or brace followed by a rehab program. A physical therapist will help you regain smooth, normal motion, proprioception, and strength. Proprioception refers to the joint’s sense of position, an important function when maintaining joint stability. This is important in preventing a second or even repeated episodes of this event.
Surgery is needed when there is severe damage such as bone fracture, muscle rupture, or detachment of the ligaments. A visit to the orthopedic surgeon would help rule out something of a more serious nature requiring surgery.
There was a reason for this episode of instability, even if it is not entirely clear to you what that might be. The surgeon will be able to evaluate your knee and possibly identify ways to prevent future episodes. That’s important because every time the kneecap dislocates, damage is done to the ligaments, soft tissues, and joint cartilage that can eventually lead to degenerative changes and possibly painful arthritis later on.