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

22
LINES

< > BotCompany Repo | #1032098 // makeAlwaysOnTopTranslucentWindow

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (4328L/24K).

1  
static JWindow makeAlwaysOnTopTranslucentWindow() {
2  
  ret makeAlwaysOnTopTranslucentWindow(screenRect(), withAlpha(.2, Color.BLUE));
3  
}
4  
5  
// component can be a custom-painted JComponent
6  
static JWindow makeAlwaysOnTopTranslucentWindow(Rect bounds, Color backgroundWithAlpha, JComponent component default null) {
7  
  ret swing(() -> {
8  
    new JWindow f;
9  
    f.setAlwaysOnTop(true);
10  
    f.setBackground(backgroundWithAlpha);
11  
    f.setBounds(toRectangle(bounds));
12  
    JComponent c = component;
13  
    if (c == null)
14  
      c = onClickDisposeWindow(
15  
        //jtransparent_recursive(jpanel())
16  
        dynamicallyPaintedComponent2((w, h, g) -> {})
17  
      );
18  
    add(f, c);
19  
    vmBus_send willShowNewAlwaysOnTopWindow(f);
20  
    ret f;
21  
  });
22  
}

Author comment

Began life as a copy of #1032087

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032098
Snippet name: makeAlwaysOnTopTranslucentWindow
Eternal ID of this version: #1032098/4
Text MD5: de27fed558d843e1d3061f3080342ed0
Transpilation MD5: 39178c99267b0ecab7b5b5af015478bf
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-08-11 14:57:44
Source code size: 745 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 141 / 202
Version history: 3 change(s)
Referenced in: [show references]