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

10
LINES

< > BotCompany Repo | #1034098 // centerFrame_oldMethod

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

Libraryless. Click here for Pure Java version (4775L/27K).

1  
static <A extends Component> A centerFrame_oldMethod(A c) {
2  
  Window w = getWindow(c);
3  
  if (w != null)
4  
    w.setLocationRelativeTo(null); // magic trick
5  
  ret c;
6  
}
7  
8  
static <A extends Component> A centerFrame_oldMethod(int w, int h, A c) {
9  
  ret centerFrame_oldMethod(setFrameSize(w, h, c));
10  
}

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: #1034098
Snippet name: centerFrame_oldMethod
Eternal ID of this version: #1034098/1
Text MD5: 903a31f273e692fd3801cac99e5f8f19
Transpilation MD5: 2683d1fb6d685b7f1df2e297e7501eaa
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-21 20:22:23
Source code size: 304 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 51 / 89
Referenced in: [show references]