} finally { if (oldDoc instanceof AbstractDocument) ((AbstractDocument) oldDoc).readUnlock(); }
  public void setDocument(Document newDoc)  {    Document oldDoc = doc;    doc = newDoc;    firePropertyChange("document", oldDoc, newDoc);    revalidate();    repaint();  }