Here you can find the source of isSecondaryWindow(JRootPane rp)
public static boolean isSecondaryWindow(JRootPane rp)
//package com.java2s; import java.awt.*; import javax.swing.*; public class Main { public static boolean isSecondaryWindow(JRootPane rp) { Component c = rp.getParent(); if (c instanceof JInternalFrame) { return true; } else {//from ww w . jav a 2s . c o m return false; } } }