Example usage for javax.swing.text Keymap getAction

List of usage examples for javax.swing.text Keymap getAction

Introduction

In this page you can find the example usage for javax.swing.text Keymap getAction.

Prototype

public Action getAction(KeyStroke key);

Source Link

Document

Fetches the action appropriate for the given symbolic event sequence.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    JTextArea component = new JTextArea();
    Keymap map = component.getKeymap();

    while (map != null) {
        KeyStroke[] keys = map.getBoundKeyStrokes();

        for (int i = 0; i < keys.length; i++) {
            System.out.println(keys[i].getKeyChar());
            Action action = (Action) map.getAction(keys[i]);
            System.out.println(action);
        }//from   w  w w .  j  a v  a  2  s . c  o  m
        Action defAction = map.getDefaultAction();
        System.out.println(defAction);
        map = map.getResolveParent();
    }
}