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

30
LINES

< > BotCompany Repo | #1006954 - onChange

JavaX fragment (include)

static <A extends JSpinner> A onChange(A spinner, O r) {
  swing { spinner.addChangeListener(changeListener(r)); }
  ret spinner;
}

static <A extends AbstractButton> A onChange(A b, O r) {
  swing { b.addItemListener(itemListener(r)); }
  ret b;
}

static void onChange(JTextComponent tc, O r) {
  onUpdate(tc, r);
}

static <A extends JSlider> A onChange(A slider, fO r) {
  swing { slider.addChangeListener(changeListener(r)); }
  ret slider;
}

static JComboBox onChange(O r, JComboBox cb) {
  ret onChange(cb, r);
}

static JComboBox onChange(JComboBox cb, fO r) {
  if (isEditableComboBox(cb))
    onChange(textFieldFromComboBox(cb), r);
  else
    onSelectedItem(cb, voidfunc(S s) { callF(r) });
  ret cb;
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1006954
Snippet name: onChange
Eternal ID of this version: #1006954/18
Text MD5: f46108c5a0ba155092d88922d671b363
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-23 14:08:17
Source code size: 743 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 487 / 662
Version history: 17 change(s)
Referenced in: [show references]