Unfortunately, you have not mentioned the duration of your scrotal swelling. Scrotal swelling of short duration may be caused by inflammation, trauma or infection, while long duration swellings may result from accumulatin of fluid around testis, called hydrocoele, or from chronic inflammation like tuberculosis. Sometimes cancerous growths in testis may cause similar swellings and pain of moderate duration. You need to see a urologist and get your self examined and investigated to reach a conclusion and have appropriate treatment.