Java JFrame Parent getParentFrame(Component parent)

Here you can find the source of getParentFrame(Component parent)

Description

get Parent Frame

License

Open Source License

Declaration

public static Frame getParentFrame(Component parent) 

Method Source Code

//package com.java2s;
import java.awt.Component;

import java.awt.Frame;

import java.awt.Window;

import javax.swing.SwingUtilities;

public class Main {
    public static Frame getParentFrame(Component parent) {
        if (parent instanceof Frame) {
            return (Frame) parent;
        }//from   w w w .  jav a 2  s  .  co  m
        Window window = SwingUtilities.windowForComponent(parent);
        return (window instanceof Frame ? (Frame) window : null);
    }
}

Related

  1. getFrameParent(Component component)
  2. getInstalledOperation(final RootPaneContainer frame, final Object actionKey, boolean selfOnly)
  3. getParentalFrame(Component n)
  4. getParentFrame(Component component)
  5. getParentFrame(Component component)
  6. getParentFrame(Component source)
  7. getParentFrame(Frame[] parentFrames)
  8. getParentFrame(JComponent c)
  9. getParentFrame(JComponent comp)