private void bind(Action action) {
        KeyStroke accelerator = (KeyStroke) action.getValue(Action.ACCELERATOR_KEY);
        if (accelerator != null) {
            component.getInputMap().put(accelerator, accelerator);
            component.getActionMap().put(accelerator, action);
        }
    }