The Notify interface provides a standard interface by which objects may receive notification of changes within other objects. The idea is as follows: The NetWorKsPanel needs to know if the Graph is modified. The GraphPanel has a notifyOnModify() method which the NetWorKsPanel uses to register itself to receive notice of any changes. The NetWorKsPanel implements the Notify interface, so the GraphPanel invokes the NetWorKsPanel modified() method whenever the Graph is modified.
package MyUtil;
public interface Notify {
public void modified(int x);
}