Libraryless. Click here for Pure Java version (4328L/24K).
static JWindow makeAlwaysOnTopTranslucentWindow() { ret makeAlwaysOnTopTranslucentWindow(screenRect(), withAlpha(.2, Color.BLUE)); } // component can be a custom-painted JComponent static JWindow makeAlwaysOnTopTranslucentWindow(Rect bounds, Color backgroundWithAlpha, JComponent component default null) { ret swing(() -> { new JWindow f; f.setAlwaysOnTop(true); f.setBackground(backgroundWithAlpha); f.setBounds(toRectangle(bounds)); JComponent c = component; if (c == null) c = onClickDisposeWindow( //jtransparent_recursive(jpanel()) dynamicallyPaintedComponent2((w, h, g) -> {}) ); add(f, c); vmBus_send willShowNewAlwaysOnTopWindow(f); ret f; }); }
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: | 140 / 201 |
Version history: | 3 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) |