1 | static int centerArrangeWindows_spacing = 20; |
2 | |
3 | static L<Window> centerArrangeWindows(final Window... windows) { |
4 | swing { |
5 | int w = centerArrangeWindows_spacing*(l(windows)-1); |
6 | for (Window win : windows) w += win.getWidth(); |
7 | int x = (screenWidth()-w)/2; |
8 | for (Window win : windows) { |
9 | setFrameLocation(win, x, (screenHeight()-win.getHeight())/2); |
10 | x += win.getWidth() + centerArrangeWindows_spacing; |
11 | } |
12 | } |
13 | ret asList(windows); |
14 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1014293 |
Snippet name: | centerArrangeWindows |
Eternal ID of this version: | #1014293/5 |
Text MD5: | 9e7c5d7148be1a3e3e57edead34484d4 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-04-20 00:20:34 |
Source code size: | 470 bytes / 14 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 435 / 464 |
Version history: | 4 change(s) |
Referenced in: | [show references] |