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

16
LINES

< > BotCompany Repo | #1001432 // moveToTopRightCorner

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

Libraryless. Click here for Pure Java version (4984L/28K).

static int moveToTopRightCorner_inset = 20;

static <A extends Component> A moveToTopRightCorner(A a) {
  ret moveToTopRightCorner(moveToTopRightCorner_inset, moveToTopRightCorner_inset, a);
}

static <A extends Component> A moveToTopRightCorner(int insetX, int insetY, A a) {
  swing {
    Window w = getWindow(a);
    if (w != null) {
      var bounds = preferredScreenBounds();
      w.setLocation(bounds.x2()-w.getWidth()-insetX, bounds.y1()+insetY);
    }
  }
  ret a;
}

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: 686 / 1234
Version history: 8 change(s)
Referenced in: #1002427 - Accellerating 629 (SPIKE)
#1006233 - moveToBottomRightCorner
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1006779 - moveToTopLeftCorner
#1033196 - screenTopRightCornerOverlayInset
#1033197 - moveToTopRightCornerWithSize
#1033889 - moveToTopRightCorner backup
#3000382 - Answer for ferdie (>> t = 1, f = 0)
#3000383 - Answer for funkoverflow (>> t=1, f=0 okay)