void () { final var preferredComponent = myPreview.getPreferredFocusedComponent(); if (preferredComponent != null) { preferredComponent.requestFocus(); return; } myPreview.getComponent().requestFocus(); }