Java Swing KeyStroke unregisterKeyBoardAction(JComponent comp, Action action)

Here you can find the source of unregisterKeyBoardAction(JComponent comp, Action action)

Description

unregister Key Board Action

License

Open Source License

Declaration

public static void unregisterKeyBoardAction(JComponent comp, Action action) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import javax.swing.Action;
import javax.swing.JComponent;
import javax.swing.KeyStroke;

public class Main {
    public static void unregisterKeyBoardAction(JComponent comp, Action action) {
        unregisterKeyBoardAction(comp, action, JComponent.WHEN_IN_FOCUSED_WINDOW);
    }//from www. j av  a 2 s  .  c  o m

    public static void unregisterKeyBoardAction(JComponent comp, Action action, int condition) {
        comp.getInputMap(condition).remove((KeyStroke) action.getValue(Action.ACCELERATOR_KEY));
        comp.getActionMap().remove(action.getValue(Action.NAME));
    }
}

Related

  1. setUpCycle(JComponent comp, int key)
  2. stringToKeyStroke(String s)
  3. strokeToPrefs(KeyStroke prefsStroke)
  4. synchronizeKeyboardActions( JComponent sourceComponent, JComponent targetComponent, KeyStroke[] keyStrokes, int condition)
  5. synchronizeKeyboardActions( JComponent sourceComponent, JComponent targetComponent, KeyStroke[] keyStrokes, int condition)
  6. withKeyStroke(M jmi, KeyStroke ks)