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