void (final FocusEvent e) { final Component opposite = e.getOppositeComponent(); if( e.isTemporary() || opposite != null && SwingUtilities.isDescendingFrom(opposite, getTopComponent()) ){ // Do nothing if focus moves inside top component hierarchy return; } // [vova] we need LaterInvocator here to prevent write-access assertions ApplicationManager.getApplication().invokeLater(() -> finishInplaceEditing(), ModalityState.nonModal()); }