Here you can find the source of fillInputMap(ActionMap am)
public static InputMap fillInputMap(ActionMap am)
//package com.java2s; //License from project: Apache License import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.InputMap; import javax.swing.KeyStroke; public class Main { public static InputMap fillInputMap(ActionMap am) { InputMap keysMap = new InputMap(); if (am != null) { Object[] oNames = am.allKeys(); if (oNames != null) { for (int i = 0; i < oNames.length; i++) { Action action = am.get(oNames[i]); Object oKey = action.getValue(Action.ACCELERATOR_KEY); if (oKey != null && oKey instanceof KeyStroke) { keysMap.put((KeyStroke) oKey, oNames[i]); }/*from w w w. jav a 2s.co m*/ } } } return keysMap; } }