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

7
LINES

< > BotCompany Repo | #1034124 // centerWindowWithin

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

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

svoid centerWindowWithin(Window w, Rect r) {
  if (w != null) swing {
    w.setLocation(
      r.x+(r.w-w.getWidth())/2,
      r.y+(r.h-w.getHeight())/2);
  }
}

Author comment

Began life as a copy of #1001308

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034124
Snippet name: centerWindowWithin
Eternal ID of this version: #1034124/1
Text MD5: 98377a9dc05a7412e436c76ec39632d2
Transpilation MD5: 75e14e5b9fce43296670797074c9dd58
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-23 21:03:35
Source code size: 166 bytes / 7 lines
Pitched / IR pitched: No / No
Views / Downloads: 80 / 118
Referenced in: [show references]