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)

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

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: 628 / 649
Version history: 4 change(s)
Referenced in: [show references]