new KeyEvent(button2, KeyEvent.KEY_PRESSED,
System.currentTimeMillis(),
KeyEvent.ALT_DOWN_MASK,
KeyEvent.VK_F4,
KeyEvent.CHAR_UNDEFINED);
button2.dispatchEvent(ke);
}
}
public boolean recogniseWindow(Window window) {
if (! (window instanceof JDialog)) return false;