Cramps are involuntary muscle contractions. That may lead to overstress of these muscles on the days you do swim, causing cramping. It's probably not related to dehydration or electrolyte depletion, because you're not cramping when you do other activities. Still, try drinking a sports drink with electrolytes about an hour before you swim. Also, try swimming more often at a slightly lower intensity.
Swimming is outstanding because it's low-impact and works several large muscle groups.
I'd like an exercise to tone my inner thighs now that summer is here. I've been walking three miles every day for eight months. We all could take a lesson from you. Sticking with exercise isn't easy. Remember, it shouldn't be about summer, but a commitment to fitness.