1 | static JFrame frameInnerSize(final Component c, final double w, final double h) { |
2 | final JFrame frame = getFrame(c); |
3 | if (frame != null) swing { |
4 | Container cp = frame.getContentPane(); |
5 | Dimension oldSize = cp.getPreferredSize(); |
6 | cp.setPreferredSize(new Dimension(iround(w), iround(h))); |
7 | frame.pack(); |
8 | cp.setPreferredSize(oldSize); |
9 | } |
10 | ret frame; |
11 | } |
12 | |
13 | static void frameInnerSize(JFrame frame, Dimension d) { |
14 | frameInnerSize(frame, d.width, d.height); |
15 | } |
16 | |
17 | static JFrame frameInnerSize(Pt p, JFrame frame) { |
18 | frameInnerSize(frame, p.x, p.y); |
19 | ret frame; |
20 | } |
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: | 650 / 633 |
Version history: | 7 change(s) |
Referenced in: | [show references] |