Taking a gun and shooting a thief could also be self-defense, such as outlined in the Castle Doctrine.
Justice is thought of as positive and law-abiding. The legal system doing its job: the police catch someone, the courts try them, the verdict is carried out.
Revenge is thought of more as a negative thing. A selfish act carried out to have your own needs fulfilled for, in your own eyes, having been wronged. Revenge is where we take the place of the legal system.