Java JFrame Parent getParentFrame(Frame[] parentFrames)

Here you can find the source of getParentFrame(Frame[] parentFrames)

Description

Find first instance of a JFrame.

License

Apache License

Parameter

Parameter Description
parentFrames a parameter

Declaration

public static JFrame getParentFrame(Frame[] parentFrames) 

Method Source Code

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

import java.awt.Frame;

import javax.swing.JFrame;

public class Main {
    /**// w w w . j a v  a2 s  .  c  om
     * Find first instance of a JFrame. In some cases there are instances of Window which will cause the dialog to fail.
     * 
     * @param parentFrames
     * @return
     */
    public static JFrame getParentFrame(Frame[] parentFrames) {
        for (Frame frame : parentFrames) {
            if (frame instanceof JFrame) {
                return (JFrame) frame;
            }
        }
        return null;
    }
}

Related

  1. getParentalFrame(Component n)
  2. getParentFrame(Component component)
  3. getParentFrame(Component component)
  4. getParentFrame(Component parent)
  5. getParentFrame(Component source)
  6. getParentFrame(JComponent c)
  7. getParentFrame(JComponent comp)
  8. getParentFrame(JComponent comp)
  9. getParentFrameForCompomponent(Component comp)