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

10
LINES

< > BotCompany Repo | #1020161 // getComboBoxItems

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

Libraryless. Click here for Pure Java version (4719L/26K).

static <A> L<A> getComboBoxItems(JComboBox<A> cb) {
  ret cb == null ?: swing(-> {
    ComboBoxModel<A> model = cb.getModel();
    int n = model.getSize();
    L<A> l = emptyList(n);
    for i to n:
      l.add(model.getElementAt(i));
    ret l;
  });
}

Author comment

Began life as a copy of #1020160

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020161
Snippet name: getComboBoxItems
Eternal ID of this version: #1020161/3
Text MD5: ce9cc2b15319426584ab25004e5093a6
Transpilation MD5: 0181f326a6791e0a156474692aff0fe6
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-13 16:19:51
Source code size: 262 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 308 / 400
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1020177 - comboBoxFindItem_withSimplifier