Java JFrame getJFrame(Component cmp)

Here you can find the source of getJFrame(Component cmp)

Description

Gets the parent JFrame of the component.

License

Open Source License

Declaration

public static JFrame getJFrame(Component cmp) 

Method Source Code

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

import java.awt.Component;

import javax.swing.JFrame;

import javax.swing.SwingUtilities;

public class Main {
    /**/*from  w w  w  .  j a  va2 s . c  om*/
     * Gets the parent JFrame of the component.
     */
    public static JFrame getJFrame(Component cmp) {
        return (JFrame) SwingUtilities.getWindowAncestor(cmp);
    }
}

Related

  1. fitToDesktop(final JFrame frame)
  2. fullScreen(JFrame window)
  3. fullScreenUsingMaximise(JFrame w)
  4. fullScreenWithAPI(JFrame w)
  5. getFileSelection(JFrame parent, boolean onlyDirectories, String startingDir)
  6. getjFrame(int width, int height)
  7. getJFrame(JPanel panel, String title, int width, int height)
  8. getJFrame(Window window)
  9. getJFrameOfComponent(Component cmpnt)