The proven method is: Spend some resources on violators - pay off court costs, place them in jobs, or in college. Track them, and if they go back on the street with gangs or violence, take all that resource away.
This works well. I've read about similar programs that address recidivism successfully. AND, these programs incur a ton of jealousy from people who aren't misbehaving in the first place. Which is why we can't sell this sort of thing politically.
Unless, of course, we had a universal basic income.
By the way, I seriously doubt that programs like this would do anything at all to stop spree killings such as Columbine, Sandy Hook, etc. They might, who really knows, but such incidents seem to have entirely different origins and motivations.