public synchronized void setFrame(@Nullable Window frame) {
    Objects.requireNonNull(myListener);
    if (myFrame != null) {
      myFrame.removeWindowListener(myListener);
    }
    myFrame = frame;
    if (myFrame != null) {
      myFrame.addWindowListener(myListener);
    }
  }
public synchronized void setFrame(@Nullable Window frame)