int modifier = key.getModifier().getCode();
KeyEvent event = new KeyEvent(component, KeyEvent.KEY_PRESSED, 0, modifier, keyCode, (char)keyCode);
if (component.getKeyListeners().length > 0) {
for (int i = 0; i < component.getKeyListeners().length; i++) {
KeyListener keyListener = component.getKeyListeners()[i];
keyListener.keyPressed(event);
}
}
SwingUtilities.processKeyBindings(event);
}