Java JButton list action map
import javax.swing.Action; import javax.swing.ActionMap; import javax.swing.JButton; public class Main { public static void main(String[] argv) throws Exception { JButton component = new JButton("button"); ActionMap map = component.getActionMap(); list(map, map.keys());//from w ww . j av a 2s. co m list(map, map.allKeys()); } static void list(ActionMap map, Object[] actionKeys) { if (actionKeys == null) { return; } for (int i = 0; i < actionKeys.length; i++) { // Get the action bound to this action key while (map.get(actionKeys[i]) == null) { map = map.getParent(); } Action action = (Action) map.get(actionKeys[i]); System.out.println(action.getValue(Action.NAME)); } } }