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

19
LINES

< > BotCompany Repo | #1026650 // centerPackInternalFrameWithMinSize

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

Transpiled version (2612L) is out of date.

1  
static <A extends Component> A centerPackInternalFrameWithMinSize(int w, int h, A c) {
2  
  ret centerPackInternalFrameWithMinSize(Pt(w, h), c);
3  
}
4  
5  
static <A extends Component> A centerPackInternalFrameWithMinSize(Pt minSize, A c) {
6  
  JInternalFrame win = getInternalFrame(c);
7  
  if (win == null || getParent(win) == null) ret c;
8  
  swing {
9  
    win.pack();
10  
    if (minSize != null) minFrameSize(win, minSize.x, minSize.y);
11  
    centerInternalFrame(win);
12  
    fixInternalFrame(win);
13  
  }
14  
  ret c;
15  
}
16  
17  
static <A extends Component> A centerPackInternalFrameWithMinSize(A c, Pt minSize) {
18  
  ret centerPackInternalFrameWithMinSize(minSize, c);
19  
}

Author comment

Began life as a copy of #1016270

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1026650
Snippet name: centerPackInternalFrameWithMinSize
Eternal ID of this version: #1026650/4
Text MD5: 4a43b0220d7e616fb96b8fb5fed745ee
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-01-18 16:27:23
Source code size: 649 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 150 / 207
Version history: 3 change(s)
Referenced in: [show references]