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

6
LINES

< > BotCompany Repo | #1009086 // setComboBoxItems - thread-safe

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

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

static <A> void setComboBoxItems(JComboBox<A> cb, Cl<A> items) {
  if (cb != null) swing {
    //if (!comboBoxItemsAre(cb, items))
      cb.setModel(new DefaultComboBoxModel(new Vector(items)));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1009086
Snippet name: setComboBoxItems - thread-safe
Eternal ID of this version: #1009086/6
Text MD5: e7e4f9ef994dc185fdf17c8d8f34b3f1
Transpilation MD5: c53dd23d835a8421ebbfc1a3a6a3a96a
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-08 19:49:40
Source code size: 205 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 642 / 714
Version history: 5 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1033917 - setComboBoxItems_notifyListeners - fire a change event when a different item is selected afterwards