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).

1  
!7
2  
3  
set flag LeanMode.
4  
set flag l_withoutReflection.
5  
set flag iround_noGeneric.
6  
//set flag Reparse.
7  
8  
p {
9  
  var screens = GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
10  
  System.out.println("Detected " + screens.length + " screen(s)");
11  
  for (int iScreen = 0; iScreen < screens.length; iScreen++) {
12  
    var screen = screens[iScreen].getDefaultConfiguration().getBounds();
13  
    
14  
    // make a grid of windows covering each screen
15  
    
16  
    int cols = 12, rows = 8;
17  
    for (Rectangle r : gridOfRectangles(screen, cols, rows)) {
18  
      new JWindow window;
19  
      window.setBounds(r);
20  
        
21  
      // faint (mostly translucent) blue background
22  
      window.setBackground(new Color(0, 0, 255, 64));
23  
      
24  
      window.setAlwaysOnTop(true);
25  
      //var label = new JLabel("Screen " + (iScreen+1) + " of " + screens.length);
26  
      //label.setHorizontalAlignment(JLabel.CENTER);
27  
      //window.add(label);
28  
      disposeWindowOnClick(window);
29  
      window.setVisible(true);
30  
    }
31  
  }
32  
    
33  
  System.out.println("Will exit in 10");
34  
  Thread.sleep(10000);
35  
  System.exit(0);
36  
}

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: 259 / 841
Version history: 11 change(s)
Referenced in: [show references]