Libraryless. Click here for Pure Java version (5124L/28K).
1 | static Rectangle defaultNewFrameBounds_r = new Rectangle(300, 100, 500, 400); |
2 | |
3 | static Rectangle defaultNewFrameBounds() {
|
4 | ret swing(func -> Rectangle {
|
5 | defaultNewFrameBounds_r.translate(60, 20); |
6 | var bounds = preferredScreenBounds(); |
7 | if (!bounds.contains(defaultNewFrameBounds_r)) |
8 | //defaultNewFrameBounds_r.setLocation(bounds.x+30+random(30), bounds.y+20+random(20)); |
9 | defaultNewFrameBounds_r.setLocation(centerX(bounds)+random_incl(-30, 30), centerY(bounds)+random_incl(-20, 20)); |
10 | ret new Rectangle(defaultNewFrameBounds_r); |
11 | }); |
12 | } |
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: | #1011065 |
| Snippet name: | defaultNewFrameBounds |
| Eternal ID of this version: | #1011065/6 |
| Text MD5: | 3e4f4b109eb61535b9030b9107e47e9b |
| Transpilation MD5: | 8fae0a6f30cbaef9ace7d7844da9ed56 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-01-09 18:08:48 |
| Source code size: | 572 bytes / 12 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 750 / 922 |
| Version history: | 5 change(s) |
| Referenced in: | [show references] |