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

11
LINES

< > BotCompany Repo | #1004496 // jPreferWidth

JavaX fragment (include) [tags: use-pretranspiled]

Transpiled version (5154L) is out of date.

1  
static <A extends Component> A jPreferWidth(int w, A c) {
2  
  swing {
3  
    Dimension size = c.getPreferredSize();
4  
    c.setPreferredSize(new Dimension(/*max(w, size.width) ??? */w, size.height));
5  
  }
6  
  ret c;
7  
}
8  
9  
static <A extends Component> A jPreferWidth(A c, int w) {
10  
  ret jPreferWidth(w, c);
11  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004496
Snippet name: jPreferWidth
Eternal ID of this version: #1004496/5
Text MD5: c7243948c3943cad80a0f4404c6f7186
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-07-29 22:44:47
Source code size: 300 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 614 / 664
Version history: 4 change(s)
Referenced in: [show references]