if (e.getPropertyName().equals("document"))
String name = e.getPropertyName();  if (name.equals("document"))
    public void propertyChange(PropertyChangeEvent e)    {      if (e.getPropertyName().equals("document"))        {          Document oldDoc = (Document) e.getOldValue();          oldDoc.removeDocumentListener(documentListener);          Document newDoc = (Document) e.getNewValue();          newDoc.addDocumentListener(documentListener);        }    }