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

11
LINES

< > BotCompany Repo | #1007373 // frameInnerWidth - set content pane width of a frame

JavaX fragment (include)

static JFrame frameInnerWidth(final int w, Component c) {
  final JFrame frame = getFrame(c);
  if (c != null) swing {
    Container cp = frame.getContentPane();
    Dimension oldSize = cp.getPreferredSize();
    cp.setPreferredSize(new Dimension(w, cp.getHeight()));
    frame.pack();
    cp.setPreferredSize(oldSize);
  }
  ret frame;
}

Author comment

Began life as a copy of #1006252

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: #1007373
Snippet name: frameInnerWidth - set content pane width of a frame
Eternal ID of this version: #1007373/4
Text MD5: 2720b0db62125ba8aab459d55d29d959
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-03-18 14:26:16
Source code size: 348 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 440 / 460
Version history: 3 change(s)
Referenced in: [show references]