What does it mean when you feel pain from your knees to the ankles and they are swollen?

Several possible. There are several possibilities. It could be a condition of fluid overload from too much salt; poor kidney function; a condtion called diastolic heart failure; a condition where the veins are inflamed; a type of infection; allergic reaction; and several other things. You really need to have your legs examined.