SubClass gets PropertyChangeSupport, and methods to add and remove the PropertyChangeListener's. You would pass this
into SubClass's PropertyChangeSupport constructor.
public class Subclass{
private PropertyChangeSupport propChangeSupport =
new PropertyChangeSupport(this);
private ArrayList store;
public void addPropertyChangeListener(PropertyChangeListener listener) {
propChangeSupport.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
propChangeSupport.removePropertyChangeListener(listener);
}
public void add(T data)
store.add(data);
propChangeSupport.firePropertyChange(...);
}
}
The key is always what class needs to have its state listened to? Since that is the SubClass, then it needs to hold the property change support. The class that does the listening is the one that adds the listener to the support.