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

8
LINES

< > BotCompany Repo | #1005391 // jMinWidth - set minimum + preferred width of Swing component

JavaX fragment (include)

static <A extends Component> A jMinWidth(final int w, final A c) {
  if (c == null) null;
  ret swing(func -> A {
    Dimension size = c.getMinimumSize();
    c.setMinimumSize(new Dimension(/*max(w, size.width) ??? */w, size.height));
    ret jPreferWidth(w, c);
  });
}

Author comment

Began life as a copy of #1004934

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1005391
Snippet name: jMinWidth - set minimum + preferred width of Swing component
Eternal ID of this version: #1005391/5
Text MD5: 417c20084fff5709662278846a441bbb
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-10 16:39:00
Source code size: 277 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 548 / 563
Version history: 4 change(s)
Referenced in: #1006006 - jMinSize - set minimum size of Swing component
#1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1007345 - jMaxWidth - set maximum width of Swing component
#1009270 - jMinWidth_pure - set minimum width of Swing component (don't set preferred width)
#1030810 - jMinWidthAtLeast - set minimum width of Swing component