public void setGlassPane (Component glass)

Sets a specified Component to be the glass pane for this root pane. The glass pane should normally be a lightweight, transparent component, because it will be made visible when ever the root pane needs to grab input events.

The new glass pane's visibility is changed to match that of the current glass pane. An implication of this is that care must be taken when you want to replace the glass pane and make it visible. Either of the following will work:

   root.setGlassPane(newGlassPane);
   newGlassPane.setVisible(true);
 
or:
   root.getGlassPane().setVisible(true);
   root.setGlassPane(newGlassPane);
 

Parameters:
glass    the Component to use as the glass pane for this JRootPane

Exceptions:
NullPointerException    if the glass parameter is null