Libraryless. Click here for Pure Java version (11346L/63K).
1 | static <B, A extends JComboBox<B>> A bindComboBoxToVar(IVarWithNotify<B> var, A cb) { |
2 | if (var != null) { |
3 | bindListenerToComponent(cb, var, (Runnable) () -> selectItem(cb, var!)); |
4 | onChange(cb, (Runnable) () -> var.set(getSelected(cb)); |
5 | } |
6 | ret cb; |
7 | } |
8 | |
9 | static <B, A extends JComboBox<B>> A bindComboBoxToVar(A cb, IVarWithNotify<B> var) { |
10 | ret bindComboBoxToVar(var, cb); |
11 | } |
Began life as a copy of #1016619
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034489 |
Snippet name: | bindComboBoxToVar |
Eternal ID of this version: | #1034489/8 |
Text MD5: | 418d316947ad9403d23f016897084a70 |
Transpilation MD5: | e0eefbf2fe7a132fabe0d75acecd6dfb |
Author: | stefan |
Category: | javax / a.i. |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2023-05-13 02:17:43 |
Source code size: | 392 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 273 / 390 |
Version history: | 7 change(s) |
Referenced in: | [show references] |