KeyEventDispatcher receive a consumed event



Hi,
in teh flow of my java program, i show a message dialog, which i close with "ESCAPE" key type, but the key also close my JDialog subclass. What is the reason ?

A Simplified version of the code is right below:

// the message
JOptionPane.showMessageDialog(frame, ...);

// i create the dialog
JDialog d = new MyJDialog(frame, true) {
{
super(frame, true);

keyEventDispatcher = new KeyEventDispatcher() {
private boolean done = false;


public boolean dispatchKeyEvent(KeyEvent e) {
if (!done && e.getKeyCode() == KeyEvent.VK_ESCAPE
&& e.getComponent() != null
&& SwingUtilities.windowForComponent(e.getComponent()) == MyJDialog.this
&& !SwingUtilities.isDescendingFrom(e.getComponent(), tableProj)
&& e.getComponent() != textEditor
&& e.getComponent() != combo) {
e.consume();
dispose();
done = true;
}
return false;
}

};

KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(keyEventDispatcher);

}
}

// i show the dialog, but it is closed
d.show();
.