Here you can find the source of removeKeyBinding(JComponent component, String key)
public static void removeKeyBinding(JComponent component, String key)
//package com.java2s; //License from project: Open Source License import javax.swing.InputMap; import javax.swing.JComponent; import javax.swing.KeyStroke; public class Main { public static void removeKeyBinding(JComponent component, String key) { int condition = JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT; InputMap inputMap = component.getInputMap(condition); // According to the docs, null should remove the action, but it does // not seem to work with Sun Java 1.4.2, new Object() works inputMap.put(KeyStroke.getKeyStroke(key), new Object()); }/*from w ww. j a v a 2 s . c om*/ }