Here you can find the source of getWindowTitle(Window window)
private static String getWindowTitle(Window window)
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.awt.Window; import javax.swing.JDialog; import javax.swing.JFrame; public class Main { private static String getWindowTitle(Window window) { String title = null;// ww w.j a v a2 s . com if (window instanceof JDialog) { title = ((JDialog) window).getTitle(); } else if (window instanceof JFrame) { title = ((JFrame) window).getTitle(); } return title; } }