@Override
  public void setContent(JComponent wrapped) {
    if (getTargetComponent() != this) {
      getTargetComponent().removeComponentListener(myListener);
    }

    super.setContent(wrapped);

    if (getTargetComponent() != this) {
      getTargetComponent().addComponentListener(myListener);
    }
    syncVisibility();
  }
@Override
  public void setContent(JComponent wrapped)