title: java property change listener
body: <p>i need to handle a change-interaction between 2 classes.</p>
  
  <pre><code>public class HeadClass {
  
  private Subclass sub;
  
  public void refresh() {...}
  
  }
  
  
  public class Subclass{
  
  ArrayList store;
  
  public void add(T data)
  store.add(data);
  firePropertyChange(...);
  }
  </code></pre>
  
  <p>Whenever the method "add" in the subclass is called the method "refresh" in HeadClass should be called!
  But in which class i should implement this line:</p>
  
  <pre><code>private PropertyChangeSupport changes = new PropertyChangeSupport(/*WHAT SHOULD BE HERE?*/);
  </code></pre>
  
  <p>If i implement it in the HeadClass i can react like this:</p>
  
  <pre><code>changes.addPropertyChangeListener(new PropertyChangeListener() {
              @Override
              public void propertyChange(PropertyChangeEvent event) {
                  refresh();
              }
          });
  </code></pre>
  
  <p>But how should i fire propertyChangeEvents from the Subclass if i cant access the propertyChangeSupport "changes"??</p>