1 /* 2 * @(#)InternalFrameFocusTraversalPolicy.java 1.4 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 package javax.swing; 8 9 10 import java.awt.Component; 11 import java.awt.FocusTraversalPolicy; 12 13 /** 14 * A FocusTraversalPolicy which can optionally provide an algorithm for 15 * determining a JInternalFrame's initial Component. The initial Component is 16 * the first to receive focus when the JInternalFrame is first selected. By 17 * default, this is the same as the JInternalFrame's default Component to 18 * focus. 19 * 20 * @author David Mendenhall 21 * @version 1.4, 12/19/03 22 * 23 * @since 1.4 24 */ 25 public abstract class InternalFrameFocusTraversalPolicy 26 extends FocusTraversalPolicy 27 { 28 29 /** 30 * Returns the Component that should receive the focus when a 31 * JInternalFrame is selected for the first time. Once the JInternalFrame 32 * has been selected by a call to <code>setSelected(true)</code>, the 33 * initial Component will not be used again. Instead, if the JInternalFrame 34 * loses and subsequently regains selection, or is made invisible or 35 * undisplayable and subsequently made visible and displayable, the 36 * JInternalFrame's most recently focused Component will become the focus 37 * owner. The default implementation of this method returns the 38 * JInternalFrame's default Component to focus. 39 * 40 * @param frame the JInternalFrame whose initial Component is to be 41 * returned 42 * @return the Component that should receive the focus when frame is 43 * selected for the first time, or null if no suitable Component 44 * can be found 45 * @see JInternalFrame#getMostRecentFocusOwner 46 * @throws IllegalArgumentException if window is null 47 */ 48 public Component getInitialComponent(JInternalFrame frame) { 49 return getDefaultComponent(frame); 50 } 51 } 52