Before you answer, here's some background to my shoulder's condition:
I seem to have a chronically weak shoulder. For instance, when I play basketball I like to try hard to intercept passes from the other team. But in order to do this, I have to very quickly extend my hand out sideways in order to catch the ball as it is about to pass me at high speed to the opposing player behind me. However, multiple times in the past when I did this, my shoulder dislocated (probably as the ball hit my hand and pushed my arm back). But I was able to pop it back in very shortly after. I think I know now that it dislocates because I'm extending my shoulder to my side, and the further back my arm goes at this extended sideways position, the more likely the ball joint in my shoulder will pop out of the cavity if a strong force is applied to it (like when a basketball hits my hand). I believe this is called an anterior dislocation. This has also happened recently when I tried bouldering. I was gripping a hold with my left arm which was extended a bit over my head and to my side. And then as I was trying to move myself it dislocated.
Maybe I have this problem because most of the workouts that I did when I was younger worked mainly my front deltoid but neglected my posterior and lateral deltoid. Plus I don't really work out my shoulders enough these days so they are quite weak. Anyways, with all that I said, what exercises can I do to strengthen my shoulder and prevent future dislocations? And can you also tell me what shoulder muscles to exercise?