Java JFrame findJFrame(Component myComponent)

Here you can find the source of findJFrame(Component myComponent)

Description

find J Frame

License

Open Source License

Declaration

public static JFrame findJFrame(Component myComponent) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.awt.Component;
import javax.swing.JFrame;

public class Main {
    public static JFrame findJFrame(Component myComponent) {
        Component currentParent = myComponent;
        JFrame myFrame = null;//from   ww w.j av  a  2s.c  om

        while (currentParent != null) {
            if (currentParent instanceof JFrame) {
                myFrame = (JFrame) currentParent;
                break;
            }
            currentParent = currentParent.getParent();
        }
        return myFrame;
    }
}

Related

  1. exitFullScreen(JFrame mainAppFrame)
  2. fileChooser(JFrame frame, boolean saveDialog, String windowName, String filterName, String filterExtension)
  3. findFileOpen(JFrame frame, String ext, String desc)
  4. findFileSave(JFrame frame, String ext, String desc)
  5. findJFrame(Component c)
  6. fitToDesktop(final JFrame frame)
  7. fullScreen(JFrame window)
  8. fullScreenUsingMaximise(JFrame w)
  9. fullScreenWithAPI(JFrame w)