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

13
LINES

< > BotCompany Repo | #1015211 - selectItem - for JComboBox or JList

JavaX fragment (include)

static JComboBox selectItem(fS item, final JComboBox cb) {
  if (cb != null) swing { cb.setSelectedItem(item); }
  ret cb;
}

static JComboBox selectItem(final JComboBox cb, fS item) {
  ret selectItem(item, cb);
}

static <A> JList<A> selectItem(JList<A> list, A item) {
  swing { selectRow(list, jlist_indexOf(list, item)); }
  ret list;
}

download  show line numbers  debug dex   

Travelled to 11 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz

No comments. add comment

Snippet ID: #1015211
Snippet name: selectItem - for JComboBox or JList
Eternal ID of this version: #1015211/5
Text MD5: e4fecb65cad4b5ff9422a6c645b58e27
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-03-31 16:50:55
Source code size: 353 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 225 / 245
Version history: 4 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1015211 & http://1015211.tinybrain.de