void (MouseEvent e) { mySelect = false; Component component = e.getComponent(); if (component == JBIntSpinner.this) { JTextField textField = getTextField(); if (textField.isEnabled() ) { MouseEvent event = SwingUtilities.convertMouseEvent(component, e, textField); IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> IdeFocusManager.getGlobalInstance().requestFocus(textField, true) ); //noinspection SSBasedInspection SwingUtilities.invokeLater(() -> textField.dispatchEvent(event)); } } }