Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.awt.Container;

import javax.swing.JFrame;

public class Main {
    public static JFrame getFrame(Container component) {
        JFrame frame = null;

        if (component != null) {
            if (component instanceof JFrame) {
                frame = (JFrame) component;
            } else {
                frame = getFrame(component.getParent());
            }
        }

        return frame;
    }
}