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

10
LINES

< > BotCompany Repo | #1026644 // paramsToButtons

JavaX fragment (include)

static L<JComponent> paramsToButtons(O... params) {
  new L<JComponent> l;
  for (int i = 0; i < l(params); i += 2)
    if (params[i] != null)
      if (params[i] instanceof JComponent)
        l.add((JComponent) params[i--]);
      else
        l.add(jbutton((S) params[i], params[i+1]));
  ret l;
}

Author comment

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: #1026644
Snippet name: paramsToButtons
Eternal ID of this version: #1026644/1
Text MD5: dcaecbcf9c6e417b4de5e97a8f74d96f
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:36:47
Source code size: 309 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 217 / 249
Referenced in: [show references]