Here you can find the source of replaceGlassPane(JFrame frame, Component newGlassPane)
public static void replaceGlassPane(JFrame frame, Component newGlassPane)
//package com.java2s; import java.awt.Component; import javax.swing.JFrame; public class Main { public static void replaceGlassPane(JFrame frame, Component newGlassPane) { Component oldGlassPane = frame.getGlassPane(); if (oldGlassPane != null) oldGlassPane.setVisible(false); if (newGlassPane != null) { frame.setGlassPane(newGlassPane); newGlassPane.setVisible(true); }//from w w w . ja va 2 s.c om } }