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

9
LINES

< > BotCompany Repo | #1030810 // jMinWidthAtLeast - set minimum width of Swing component

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

Libraryless. Click here for Pure Java version (2915L/17K).

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

Author comment

Began life as a copy of #1005391

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, vouqrxazstgt

No comments. add comment

Snippet ID: #1030810
Snippet name: jMinWidthAtLeast - set minimum width of Swing component
Eternal ID of this version: #1030810/3
Text MD5: b53abe2514447a8006faa37041af338f
Transpilation MD5: 2dc7df2129049be0c476b2092b6f9096
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-03-28 19:27:34
Source code size: 296 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 136 / 217
Version history: 2 change(s)
Referenced in: [show references]