Java JFrame getParentJFrame(java.awt.Container component)

Here you can find the source of getParentJFrame(java.awt.Container component)

Description

get Parent J Frame

License

Open Source License

Declaration

protected static JFrame getParentJFrame(java.awt.Container component) 

Method Source Code

//package com.java2s;

import javax.swing.JFrame;

public class Main {
    protected static JFrame getParentJFrame(java.awt.Container component) {

        while (component != null) {

            if (component.getClass().toString().equals("class javax.swing.JFrame")
                    || component.getClass().getSuperclass().toString().equals("class javax.swing.JFrame")) {

                return (JFrame) component;
            }/*from  w  w w.  ja  v a2 s  .c o m*/

            component = component.getParent();
        }

        return null;

    }
}

Related

  1. getJFrame(Window window)
  2. getJFrameOfComponent(Component cmpnt)
  3. getModalDlg(JFrame frame, String title)
  4. getParentJFrame(Component c)
  5. getParentJFrame(Container theFrame)
  6. getPersistentExtendedStateMask(JFrame frame)
  7. getRootJFrame(Component c)
  8. getRootJFrame(Component component)
  9. getTheJFrame(String title, int width, int height, int x, int y)