abstract sclass DynFullscreen > DynModule { transient JFrame fullScreenFrame; void goFullscreen enter { if (fullScreenFrame != null) ret with activateFrame(fullScreenFrame); fullScreenFrame = showFullScreen(fullscreenVisualize()); onFrameClose(fullScreenFrame, r { fullScreenFrame = null; }); } JComponent fullscreenVisualize() { null; } void exitFullscreen enter { disposeFrame(fullScreenFrame); } // works only when we are in fullscreen mode void setFullscreenComponent(JComponent c) { setFrameContents(fullScreenFrame, c); } }