First, I make GlassPane visible, then I add JInternalFrame to it. The GlassPane successfully blocks access to GUI elements under it HOWEVER when I try to resize JInternalFrame the GlassPane disappears and I have no idea why.

The internal frame sits still on it. It looks like something changes setVisible method of the Glasspane to false... How to fix it?

Here is some code. When I resize JInternalFrame the glassPane goes missing.