Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

import java.awt.Component;

import java.awt.Window;

import javax.swing.SwingUtilities;

public class Main {
    static Window getComponentWindow(Component component) {
        if (component instanceof Window) {
            return (Window) component;
        }
        return SwingUtilities.getWindowAncestor(component);
    }
}