code: static void escapePressed() {
  		final Component focusOwner = getPermanentFocusOwner();
  		final Window focusedWindow = SwingUtilities.getWindowAncestor(focusOwner);
  		if (focusedWindow instanceof Dialog && ((Dialog) focusedWindow).isModal()) {
  			//			try {
  			//				final Robot robot = new Robot();
  			//				robot.keyPress(KeyEvent.VK_ALT);
  			//				robot.keyPress(KeyEvent.VK_F4);
  			//				robot.keyRelease(KeyEvent.VK_F4);
  			//				robot.keyRelease(KeyEvent.VK_ALT);
  			//			} catch (final AWTException e) {
  			//				throw new IllegalStateException(e);
  			//			}
  			focusedWindow.dispose();
  		}
  	}
docs: La touche Esc a été pressée : fermer la dialogue modale ouverte.