Here you can find the source of synchronizeKeyboardActions( JComponent sourceComponent, JComponent targetComponent, KeyStroke[] keyStrokes, int condition)
public static void synchronizeKeyboardActions( JComponent sourceComponent, JComponent targetComponent, KeyStroke[] keyStrokes, int condition)
//package com.java2s; //License from project: Open Source License import java.awt.event.ActionListener; import javax.swing.JComponent; import javax.swing.KeyStroke; public class Main { public static void synchronizeKeyboardActions( JComponent sourceComponent, JComponent targetComponent, KeyStroke[] keyStrokes, int condition) /* */{/*from w w w .java 2 s . co m*/ /* 3517 */for (KeyStroke keyStroke : keyStrokes) { /* 3518 */ActionListener actionListener = sourceComponent .getActionForKeyStroke(keyStroke); /* 3519 */if (actionListener != null) /* 3520 */targetComponent.registerKeyboardAction( actionListener, keyStroke, condition); /* */} /* */} }