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

34
LINES

< > BotCompany Repo | #1007651 // onChangeAndNow - synonym of onUpdateAndNow (for JTextComponent, JCheckBox and others)

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

Transpiled version (8355L) is out of date.

1  
// action = runnable or method name
2  
static void onChangeAndNow(JComponent c, O r) {
3  
  onUpdateAndNow(c, r);
4  
}
5  
6  
static void onChangeAndNow(L<? extends JComponent> l, O r) {
7  
  onUpdateAndNow(l, r);
8  
}
9  
10  
svoid onChangeAndNow(JTextComponent c, IVF1<S> r) {
11  
  onUpdateAndNow(c, r);
12  
}
13  
14  
static <A> JComboBox<A> onChangeAndNow(JComboBox<A> cb, IVF1<A> f) {
15  
  onChange(cb, f);
16  
  f?.get(getSelectedItem_typed(cb));
17  
  ret cb;
18  
}
19  
20  
static <A extends JTabbedPane> A onChangeAndNow(A tabs, Runnable r) {
21  
  if (r != null) {
22  
    onChange(tabs, r);
23  
    r.run();
24  
  }
25  
  ret tabs;
26  
}
27  
28  
static JSlider onChangeAndNow(JSlider s, Runnable f) {
29  
  if (s != null && f != null) {
30  
    onChange(s, f);
31  
    f.run();
32  
  }
33  
  ret s;
34  
}

Author comment

Began life as a copy of #1006125

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1007651
Snippet name: onChangeAndNow - synonym of onUpdateAndNow (for JTextComponent, JCheckBox and others)
Eternal ID of this version: #1007651/15
Text MD5: e87d1cedef1e288216dbc022200d86c3
Author: stefan
Category: javax swing
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-10 19:23:42
Source code size: 729 bytes / 34 lines
Pitched / IR pitched: No / No
Views / Downloads: 615 / 749
Version history: 14 change(s)
Referenced in: [show references]