Do you have any burning sensation in the urine as well?
There are certain diagnostic possibilities based on the symptoms you have described:
(inflammation of the testis and the cord) - this can lead to the discomforting pain your are describing. It is usually associated with burning sensation in the urine. This problem can be treated by a course of antibiotics.
2. stone in the urinary system
- a small stone can lead to pain in the testicles and the lower part of the stomach
3. a small nodule in the testis, which is not apparent on palpation - you will need to get an ultrasound
I would suggest that you consult a doctor and have him examine you, following which you can have an ultrasound of the abdomen and testis.
Hopefully it is not something serious.