There are different reasons for swelling and pain. Dental caries, the eruption of wisdom teeth, gum or teeth infection can create pain and swelling. You should visit a dentist and get the treatment done. Medicines will help you to get relief for some days. However dental treatment is needed. Dental treatments like root canal treatment, Deep cleaning or extraction of teeth can be done.