void () { super.addNotify(); myCommitMessage.getEditorField().getFocusTarget().addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { myPrefferedFocused = myCommitMessage.getEditorField(); } }); }