static <A extends JComponent> A jMaxWidth(int w, A c) { Dimension size = c.getMaximumSize(); c.setMaximumSize(new Dimension(w, size.height)); ret jPreferWidth(w, c); // this helps } static <A extends JComponent> A jMaxWidth(A c, int w) { ret jMaxWidth(w, c); }
Began life as a copy of #1005391
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1007345 |
Snippet name: | jMaxWidth - set maximum width of Swing component |
Eternal ID of this version: | #1007345/8 |
Text MD5: | 3925d2d4a59ae86cc526b14578ccc782 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2021-05-06 14:13:57 |
Source code size: | 273 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 548 / 572 |
Version history: | 7 change(s) |
Referenced in: | [show references] |