public static GlassPaneState showGlassPane ( final Component source ) { final Component focusOwner = KeyboardFocusManager . getCurrentKeyboardFocusManager ( ) . getFocusOwner ( ) ; final RootPaneContainer rootPaneContainer = findRootPaneContainer ( source ) ; final Component glassPane = rootPaneContainer . getGlassPane ( ) ; final MouseListener mouseListener = new MouseAdapter ( ) { } ; final Cursor cursor = glassPane . getCursor ( ) ; glassPane . addMouseListener ( mouseListener ) ; glassPane . setVisible ( true ) ; glassPane . requestFocus ( ) ; glassPane . setCursor ( new Cursor ( Cursor . WAIT_CURSOR ) ) ; return new GlassPaneState ( glassPane , mouseListener , focusOwner , cursor ) ; }
Makes the glass pane visible and focused and stores the saves the current state .