Here you can find the source of removeShortcut(JRootPane rootPane, String command, KeyStroke stroke)
public static void removeShortcut(JRootPane rootPane, String command, KeyStroke stroke)
//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); } }