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

10
LINES

< > BotCompany Repo | #1001308 - centerFrame

JavaX fragment (include)

static <A extends Component> A centerFrame(A c) {
  Window w = getWindow(c);
  if (w != null)
    w.setLocationRelativeTo(null); // magic trick
  ret c;
}

static <A extends Component> A centerFrame(int w, int h, A c) {
  ret centerFrame(setFrameSize(w, h, c));
}

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: #1001308
Snippet name: centerFrame
Eternal ID of this version: #1001308/7
Text MD5: 17a8df43a5f8c4ae805420694cc5bc4b
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-02 00:02:00
Source code size: 274 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 551 / 1164
Version history: 6 change(s)
Referenced in: [show references]