JTextComponent.KeyBinding[] bindings = (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings");
InputMapUIResource m = (InputMapUIResource) UIManager.get(prefix + ".focusInputMap"); if (m != null) { KeyStroke[] keys = m.keys(); int len = keys.length; bindings = new JTextComponent.KeyBinding[len]; for (int i = 0; i < len; i++) { KeyStroke curr = keys[i]; bindings[i] = new JTextComponent.KeyBinding(curr, (String) m.get(curr)); } }
  protected Keymap createKeymap()  {    String prefix = getPropertyPrefix();    JTextComponent.KeyBinding[] bindings =       (JTextComponent.KeyBinding[]) UIManager.get(prefix + ".keyBindings");    if (bindings == null)      {        bindings = new JTextComponent.KeyBinding[0];        // FIXME: Putting something into the defaults map is certainly wrong.        // Must be fixed somehow.        UIManager.put(prefix + ".keyBindings", bindings);      }    Keymap km = JTextComponent.addKeymap(getKeymapName(),                                          JTextComponent.getKeymap(JTextComponent.DEFAULT_KEYMAP));        JTextComponent.loadKeymap(km, bindings, textComponent.getActions());    return km;      }