void () { if (myGlassPane != null) { return; } UiNotifyConnector.installOn(myDragComponent, new Activatable() { @Override public void showNotify() { attach(); } @Override public void hideNotify() { detach(true); } }); Disposer.register(myParentDisposable, () -> stop()); }