Class WindowAncestorFinder

java.lang.Object
org.fest.swing.core.WindowAncestorFinder

public final class WindowAncestorFinder extends Object
Understands lookup of a component's ancestor.
  • Field Details

  • Constructor Details

    • WindowAncestorFinder

      private WindowAncestorFinder()
  • Method Details

    • windowAncestorOf

      @RunsInCurrentThread public static Window windowAncestorOf(Component c)
      Similar to SwingUtilities.getWindowAncestor(Component), but returns the Component itself if it is a Window, or the invoker's Window if on a pop-up.

      Note: This method is not executed in the event dispatch thread (EDT.) Clients are responsible for invoking this method in the EDT.

      Parameters:
      c - the Component to get the Window ancestor of.
      Returns:
      the Window ancestor of the given Component, the Component itself if it is a Window, or the invoker's Window if on a pop-up.