Libraryless. Click here for Pure Java version (4984L/28K).
1 | static int moveToTopRightCorner_inset = 20; |
2 | |
3 | static <A extends Component> A moveToTopRightCorner(A a) { |
4 | ret moveToTopRightCorner(moveToTopRightCorner_inset, moveToTopRightCorner_inset, a); |
5 | } |
6 | |
7 | static <A extends Component> A moveToTopRightCorner(int insetX, int insetY, A a) { |
8 | swing { |
9 | Window w = getWindow(a); |
10 | if (w != null) { |
11 | var bounds = preferredScreenBounds(); |
12 | w.setLocation(bounds.x2()-w.getWidth()-insetX, bounds.y1()+insetY); |
13 | } |
14 | } |
15 | ret a; |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1001432 |
Snippet name: | moveToTopRightCorner |
Eternal ID of this version: | #1001432/9 |
Text MD5: | 9d3ec3d527470793a573bd7e1782703e |
Transpilation MD5: | ad533a74f46c3ba464a41d3ecf7ceae8 |
Author: | stefan |
Category: | |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-09 17:34:21 |
Source code size: | 492 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 748 / 1325 |
Version history: | 8 change(s) |
Referenced in: | [show references] |