List of usage examples for java.awt Container addKeyListener
public synchronized void addKeyListener(KeyListener l)
From source file:Main.java
public static void addKeyAdapterRecursively(final Container container, final KeyAdapter keyAdapter) { container.addKeyListener(keyAdapter); for (int i = 0; i < container.getComponentCount(); i++) { final Component child = container.getComponent(i); if (child instanceof Container) { addKeyAdapterRecursively((Container) child, keyAdapter); }/*from w ww.j a va 2 s .co m*/ child.addKeyListener(keyAdapter); } }