void (@NotNull JComponent component) { AppUIExecutor.onWriteThread(ModalityState.any()).expireWith(myProject).execute(() -> { if (myCurrentComponent != null) { if (myCurrentUsageView != null && myCurrentComponent == myCurrentUsageView.getComponent()){ Disposer.dispose(myCurrentUsageView); myCurrentUsageView = null; } remove(myCurrentComponent); } myCurrentComponent = component; add(component, BorderLayout.CENTER); revalidate(); }); }