sclass TranslucentWindowTest { new L windows; run { var screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices(); System.out.println("Detected " + screens.length + " screen(s)"); for (int iScreen = 0; iScreen < screens.length; iScreen++) { var screen = screens[iScreen].getDefaultConfiguration().getBounds(); // place window in center of screen new JWindow window; window.setBounds( screen.x+screen.width/4, screen.y+screen.height/4, screen.width/2, screen.height/2); // faint (mostly translucent) blue background window.setBackground(new Color(0, 0, 255, 64)); window.setAlwaysOnTop(true); var label = new JLabel("Screen " + (iScreen+1) + " of " + screens.length); label.setHorizontalAlignment(JLabel.CENTER); window.add(label); window.setVisible(true); windows.add(window); } doAfter(10.0, r { disposeWindows(windows); }); } }