A hydrocele occurs when fluid builds up in the layer of tissue that covers the testicle. This can cause pain or swelling in the scrotum. Hydrocelectomy is surgery to remove the hydrocele. Learn more about this condition.