Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

36
LINES

< > BotCompany Repo | #1034016 // Translucent JWindow multi-screen bug demo 2 [finally shows the bug]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (97L/2K).

!7

set flag LeanMode.
set flag l_withoutReflection.
set flag iround_noGeneric.
//set flag Reparse.

p {
  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();
    
    // make a grid of windows covering each screen
    
    int cols = 12, rows = 8;
    for (Rectangle r : gridOfRectangles(screen, cols, rows)) {
      new JWindow window;
      window.setBounds(r);
        
      // 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);
      disposeWindowOnClick(window);
      window.setVisible(true);
    }
  }
    
  System.out.println("Will exit in 10");
  Thread.sleep(10000);
  System.exit(0);
}

Author comment

Began life as a copy of #1034002

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, gwrvuhgaqvyk, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034016
Snippet name: Translucent JWindow multi-screen bug demo 2 [finally shows the bug]
Eternal ID of this version: #1034016/12
Text MD5: c9bbe65e0ada0994db6172d9ce19bdb0
Transpilation MD5: 650434173cd9366255eb99cee490d300
Author: stefan
Category: javax / gui
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-17 14:44:08
Source code size: 1120 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 94 / 479
Version history: 11 change(s)
Referenced in: [show references]