Here you can find the source of unmaskContainer(JPanel pnl)
public static void unmaskContainer(JPanel pnl)
//package com.java2s; //License from project: Apache License import javax.swing.*; import java.awt.*; public class Main { public static void unmaskContainer(JPanel pnl) { WindowConstants container = getOutermostContainer(pnl); if (container == null) { return; }//w w w .j av a 2 s. c o m if (container instanceof JDialog) { unmaskWindow((JDialog) container); } else if (container instanceof JFrame) { unmaskWindow((JFrame) container); } else if (container instanceof JInternalFrame) { unmaskWindow((JInternalFrame) container); } } private static WindowConstants getOutermostContainer(JPanel container) { Container pnl = container; while (pnl.getParent() != null) { if (pnl.getParent() instanceof JInternalFrame) { return (JInternalFrame) pnl.getParent(); } if (pnl.getParent() instanceof JDialog) { return (JDialog) pnl.getParent(); } if (pnl.getParent() instanceof JFrame) { return (JFrame) pnl.getParent(); } pnl = pnl.getParent(); } return null; } public static <W extends Component & RootPaneContainer> void unmaskWindow(W window) { if (!window.isDisplayable()) { return; } window.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); if (window.getGlassPane() != null) { window.getGlassPane().setVisible(false); } } }