Java Swing KeyStroke removeShortcut(JRootPane rootPane, String command, KeyStroke stroke)

Here you can find the source of removeShortcut(JRootPane rootPane, String command, KeyStroke stroke)

Description

remove Shortcut

License

Apache License

Declaration

public static void removeShortcut(JRootPane rootPane, String command, KeyStroke stroke) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.swing.*;

public class Main {
    public static void removeShortcut(JRootPane rootPane, String command, KeyStroke stroke) {
        InputMap inputMap = rootPane.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
        inputMap.remove(stroke);/*  ww w.  j a  v a  2 s.c  om*/
        rootPane.getActionMap().remove(command);
    }
}

Related

  1. removeAcceleratorFromComponent(JComponent component, KeyStroke accelerator)
  2. removeAcceleratorFromMap(InputMap map, KeyStroke accelerator)
  3. removeButtonClickKeystroke(AbstractButton b, KeyStroke key)
  4. removeKeyBinding(JComponent component, String key)
  5. removeKeyCode(JComponent comp, int keyCode)
  6. setAcceleratorKey(Action action, KeyStroke acceleratorKey)
  7. setActionKeyBinding(final JComponent component, final int condition, final KeyStroke keyStroke, final Action action)
  8. setGlobalAccelerator(JComponent component, KeyStroke accelerator, Action action)
  9. setHotKeyForFocus(final JComponent comp, final String keyStroke, final String actionName)