Why is the slider part of the Ball class, it has nothing to do with this class.

Your problem is you are adding the slider from a ball but then you are creating another ball which you are doing something with. The new ball has it's own slider which is a different slider to the one you have added to the screen and hence it's stateChanged() method is never being called.