Here you can find the source of installFocusCycleRoot(Container c, FocusTraversalPolicy cyclePolicy)
public static void installFocusCycleRoot(Container c, FocusTraversalPolicy cyclePolicy)
//package com.java2s; /******************************************************************************* * Copyright (c) 2010 BSI Business Systems Integration AG. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors://w w w. j a v a 2 s . c o m * BSI Business Systems Integration AG - initial API and implementation ******************************************************************************/ import java.awt.Container; import java.awt.FocusTraversalPolicy; import javax.swing.RootPaneContainer; public class Main { /** * installs a focus cycle, its keys and the (optional) policy */ public static void installFocusCycleRoot(Container c, FocusTraversalPolicy cyclePolicy) { c.setFocusCycleRoot(true); c.setFocusTraversalPolicy(cyclePolicy); if (c instanceof RootPaneContainer) { Container contentPane = ((RootPaneContainer) c).getContentPane(); if (contentPane != null) { contentPane.setFocusTraversalPolicy(null); contentPane.setFocusCycleRoot(false); } } } }