Java JFrame Parent getRootFrame(Component aComp)

Here you can find the source of getRootFrame(Component aComp)

Description

get Root Frame

License

Apache License

Declaration

public static JFrame getRootFrame(Component aComp) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.awt.Component;

import javax.swing.JFrame;

public class Main {
    public static JFrame getRootFrame(Component aComp) {
        Component lParent = aComp;
        while (lParent != null && !(lParent instanceof JFrame)) {
            lParent = lParent.getParent();
        }//  w ww . j a v  a 2  s .  c  om
        if (lParent != null && lParent instanceof JFrame) {
            return (JFrame) lParent;
        }
        return null;
    }
}

Related

  1. getParentFrame(JComponent comp)
  2. getParentFrameForCompomponent(Component comp)
  3. getParentInternalFrame(Component comp)
  4. getRealFrameParent(Component c)
  5. getRootFrame()
  6. getRootFrame(Component c)
  7. getRootFrame(java.awt.Component c)
  8. getRootFrame(JComponent component)
  9. getSpssInstallationDirectory(Frame parent)