Here you can find the source of registerTabKey(Container container)
public static void registerTabKey(Container container)
//package com.java2s; //License from project: Open Source License import java.awt.Component; import java.awt.Container; import java.awt.DefaultKeyboardFocusManager; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JComponent; import javax.swing.KeyStroke; public class Main { public static void registerTabKey(Container container) /* */{/*from ww w .j a va2s. co m*/ /* 2074 */if ((container instanceof JComponent)) { /* 2075 */((JComponent) container).registerKeyboardAction( new AbstractAction() /* */{ /* */public void actionPerformed(ActionEvent e) /* */{ /* 2079 */DefaultKeyboardFocusManager .getCurrentKeyboardFocusManager() .focusNextComponent(); /* */} /* */ } /* */, KeyStroke.getKeyStroke(9, 0), 0); /* */} /* */else /* */{ /* 2084 */for (int i = 0; i < container.getComponentCount(); i++) { /* 2085 */Component c = container.getComponent(i); /* */ /* 2088 */if (((c instanceof JComponent)) && (c.isFocusable())) /* 2089 */((JComponent) container) .registerKeyboardAction(new AbstractAction() /* */{ /* */public void actionPerformed( ActionEvent e) /* */{ /* 2093 */DefaultKeyboardFocusManager .getCurrentKeyboardFocusManager() .focusNextComponent(); /* */} /* */ } /* */, KeyStroke.getKeyStroke(9, 0), 0); /* */} /* */} /* */} }