Libraryless. Click here for Pure Java version (4173L/28K).
1 | static JPanel jcenteredbuttons_withPopDown(int maxToShow, O... params) { |
2 | new L<JComponent> l; |
3 | new L popDownParams; |
4 | for (int i = 0; i < l(params); i += 2) |
5 | if (params[i] != null) { |
6 | if (l(l) >= maxToShow) { |
7 | popDownParams.add((S) params[i]); |
8 | popDownParams.add(params[i+1]); |
9 | } else |
10 | if (params[i] instanceof JComponent) |
11 | l.add((JComponent) params[i--]); |
12 | else |
13 | l.add(jbutton((S) params[i], params[i+1])); |
14 | } |
15 | if (nempty(popDownParams)) |
16 | l.add(jPopDownButton_noText(toObjectArray(popDownParams)); |
17 | ret jcenteredline(l); |
18 | } |
Began life as a copy of #1010175
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1026645 |
Snippet name: | jcenteredbuttons_withPopDown - hide some buttons in pop-down menu |
Eternal ID of this version: | #1026645/1 |
Text MD5: | b09f7b99824a39caaeffd8d73d6cf7a8 |
Transpilation MD5: | 3f0e093e1e01e26f2120d528aac8b212 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-01-18 15:41:45 |
Source code size: | 610 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 249 / 336 |
Referenced in: | [show references] |