sint packFrame_minw = 150, packFrame_minh = 50; static <A extends Component> A packFrame(final A c) { swing { Window w = getWindow(c); if (w != null) { w.pack(); int maxW = getScreenWidth()-50, maxH = getScreenHeight()-50; w.setSize( min(maxW, max(w.getWidth(), packFrame_minw)), min(maxH, max(w.getHeight(), packFrame_minh))); } } ret c; } static JFrame packFrame(ButtonGroup g) { ret packFrame(getFrame(g)); }
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: | #1003296 |
Snippet name: | packFrame - improved version of JFrame.pack() (with minimum & maximum size) |
Eternal ID of this version: | #1003296/8 |
Text MD5: | 09dd673669d4ec66186c3756ebbf72de |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-05-08 16:10:45 |
Source code size: | 485 bytes / 19 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 628 / 624 |
Version history: | 7 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1006700 - packFrameInTopRightCorner #1007757 - packFrameHeight - only change frame's height #1015134 - packWindow - packs differently than packFrame! #1015797 - packInternalFrame |