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

13
LINES

< > BotCompany Repo | #1016730 // jFixedSize - set minimum size, preferred size + maximum size of Swing component

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

Libraryless. Click here for Pure Java version (5161L/28K).

1  
static <A extends Component> A jFixedSize(int w, int h default w, A c) {
2  
  if (c != null) swing {
3  
    Dimension d = new Dimension(w, h);
4  
    c.setMinimumSize(d);
5  
    c.setPreferredSize(d);
6  
    c.setMaximumSize(d);
7  
  }
8  
  ret c;
9  
}
10  
11  
static <A extends Component> A jFixedSize(A c, Dimension d) {
12  
  ret jFixedSize(d.width, d.height, c);
13  
}

Author comment

Began life as a copy of #1006006

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1016730
Snippet name: jFixedSize - set minimum size, preferred size + maximum size of Swing component
Eternal ID of this version: #1016730/7
Text MD5: 75b751e06274082e043b86f58bdffa0d
Transpilation MD5: e22fa0ad8fe91739d980f6bccca4bb83
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-29 01:52:41
Source code size: 345 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 415 / 522
Version history: 6 change(s)
Referenced in: [show references]