code: private void addCancelByEscapeKey() {
  		int noModifiers = 0;
  		KeyStroke escapeKey = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, noModifiers, false);
  		addActionKeyBinding(escapeKey, cancelCommand.getId());
  	}
docs: Force the escape key to call the same action as pressing the Cancel
  button. This does not always work. See class comment.