sclass ScreenOverlay is AutoCloseable { JWindow window; Color bgColor = colorWithAlpha(Color.blue, 128); settable Rect bounds; settable bool hideOnMouseOver; void show() swing { if (window == null) { assertNotNull(+bounds); window = new JWindow; window.setBackground(bgColor); main setBounds(window, bounds); window.setAlwaysOnTop(true); if (hideOnMouseOver) addMouseListener(getContentPane(window), new MouseAdapter { @Override public void mouseEntered(MouseEvent e) { hide(); } }); } window.setVisible(true); } void hide aka close() swing { if (window == null) ret; window.setVisible(false); } }