I recommend a stop at the pharmacy to pick up a small, inexpensive vial of antidote before heading to the beach. Keep it with you for peace of mind and you'll be prepared in the unhappy event of a jellyfish infestation.
How to Avoid Jellyfish Stings
Avoiding the water completely is foolproof. If no one is in the water on a hot day, jellyfish are usually the reason. Scrutinize the water. Jellyfish float close to the surface and are easily visible. Ask others on the beach or a lifeguard if one is handy. Local pharmacies sell a product called Medusyl which has been found to prevent jellyfish stings by preventing the tentacle from binding. It also works as a sunscreen. Wearing a wet suit or any other covering is also effective as only bare skin is subject to the stinging tentacles.
What to Do if Stung
Although not mortal, a jellyfish sting can be quite painful. If you're stung, it's best to head to the nearest lifeguard/firstaid station as the lifeguards are equipped with an antidote. Do NOT try to wash off the sting in fresh water which will only worsen it. A more effective on-the-spot treatment is to soak the area in salt water and then rub with gravel as you want to remove the stingers. Immersing the area in water as hot as you can stand is also effective. Contrary to myth, urinating on the sting is useless.
How to Avoid Jellyfish
Yes, you can swim and completely avoid jellyfish if you swim where anti-jellyfish nets protect the swimming area. In Nice such nets are impractical but try here:
Meanwhile, you can track the location of jellyfish swarms here on a map which is updated daily.