JComponent () { String text = getTextInClipboard(); if (text == null || text.isEmpty()) { return myEditorPanel.getEditorComponent(); } JRootPane pane = getRootPane(); return pane != null ? pane.getDefaultButton() : super.getPreferredFocusedComponent(); }