void (@NotNull String viewName, boolean requestFocus) { if (!StringUtil.equals(viewName, myVisibleViewRef.get())) { myVisibleViewRef.set(viewName); CardLayout cl = (CardLayout)(getLayout()); cl.show(this, viewName); } if (requestFocus) { ComponentContainer view = getView(viewName); UiNotifyConnector.Once.installOn(view.getComponent(), new Activatable() { @Override public void showNotify() { view.getPreferredFocusableComponent().requestFocusInWindow(); } }); } }