static JFrame frameInnerSize(final Component c, final double w, final double h) { final JFrame frame = getFrame(c); if (frame != null) swing { Container cp = frame.getContentPane(); Dimension oldSize = cp.getPreferredSize(); cp.setPreferredSize(new Dimension(iround(w), iround(h))); frame.pack(); cp.setPreferredSize(oldSize); } ret frame; } static void frameInnerSize(JFrame frame, Dimension d) { frameInnerSize(frame, d.width, d.height); } static JFrame frameInnerSize(Pt p, JFrame frame) { frameInnerSize(frame, p.x, p.y); ret frame; }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006237 |
Snippet name: | frameInnerSize - set content pane size of a frame |
Eternal ID of this version: | #1006237/8 |
Text MD5: | e32356796b4b138694f23e1a9295f14a |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-03-20 13:10:32 |
Source code size: | 593 bytes / 20 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 649 / 632 |
Version history: | 7 change(s) |
Referenced in: | [show references] |