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

11
LINES

< > BotCompany Repo | #1035882 // looselyBindLiveValueToSpinner - only grab once upon display, but save on every user interaction

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

Transpiled version (9700L) is out of date.

1  
static JSpinner looselyBindLiveValueToSpinner (IVarWithNotify<Int> lv, JSpinner spinner) {
2  
  onChange(spinner, -> lv.set(intFromSpinner(spinner)));
3  
  bindToComponent(spinner, -> {
4  
    Int value = lv!;
5  
    if (value != null)
6  
      setSpinnerValue(spinner, value);
7  
    else
8  
      lv.set(intFromSpinner(spinner));
9  
  });
10  
  ret spinner;
11  
}

Author comment

Began life as a copy of #1033703

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035882
Snippet name: looselyBindLiveValueToSpinner - only grab once upon display, but save on every user interaction
Eternal ID of this version: #1035882/4
Text MD5: 448ca7fda442812c6612b930860c958a
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-06 21:48:36
Source code size: 343 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 218 / 279
Version history: 3 change(s)
Referenced in: [show references]