Java JComponent Container getRootWindow(Component component)

Here you can find the source of getRootWindow(Component component)

Description

get rootwindow for a component

License

Open Source License

Declaration

public static Window getRootWindow(Component component) 

Method Source Code

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

import java.awt.Component;

import java.awt.Window;

import javax.swing.SwingUtilities;

public class Main {
    /**//from  www.j  a v a 2s.c  o m
     * get rootwindow for a component
     */
    public static Window getRootWindow(Component component) {
        Component root = SwingUtilities.getRoot(component);
        if (root instanceof Window) {
            return (Window) root;
        }
        return null;
    }
}

Related

  1. getRootContainer(Component c)
  2. getRootPane(Component cmp)
  3. getRootPane(final Component component)
  4. getRootPaneContainer(Component c)
  5. getRootPaneContainer(Component c)
  6. getStringValue(JComponent component)
  7. getTopAncestor(JComponent start)
  8. getTopLevelContainer(JComponent component)
  9. getWindow(final JComponent comp)