if (newDoc != null)
    public void propertyChange(PropertyChangeEvent e)    {      String name = e.getPropertyName();             if (name.equals("document"))        {          Document oldDoc = (Document) e.getOldValue();          oldDoc.removeDocumentListener(documentListener);          Document newDoc = (Document) e.getNewValue();          newDoc.addDocumentListener(documentListener);        }      else if (name.equals("editable"))        {          active = (((Boolean) e.getNewValue()).booleanValue()                   && textComponent.isEnabled());        }      else if (name.equals("enabled"))        {          active = (((Boolean) e.getNewValue()).booleanValue()                   && textComponent.isEditable());        }          }