Here you can find the source of getJFrame(Window window)
public static JFrame getJFrame(Window window)
//package com.java2s; //License from project: Apache License import java.awt.Window; import javax.swing.JFrame; public class Main { public static JFrame getJFrame(Window window) { if (window instanceof JFrame) { return (JFrame) window; }// w w w . j av a 2 s . co m return null; } }