Code example for PropertyChangeEvent

0
    public void setCurrentPlayer(Player player) {
        if (player != mCurrentPlayer) {
            Player oldPlayer = mCurrentPlayer;
            mCurrentPlayer = player;
             
            PropertyChangeUtil.firePropertyChangeEvent(listeners, new PropertyChangeEvent(this, PROP_CHG_PLAYER, oldPlayer, player));
        } 
    } 
     
    public SoundPlayer getSoundPlayer() { 
        if (mSoundPlayer == null) {
            mSoundPlayer = new SoundPlayer();
            mSoundPlayer.initialize(this);
        } 
         
        return mSoundPlayer;
    } 
     
    public ScoreDAO getDAO() { 
        if (mDAO == null) {
            mDAO = new ScoreDAO(this);