Libraryless. Click here for Pure Java version (5612L/31K).
1 | static <A extends JComponent> A bindListenerToComponent(A component, IHasChangeListeners source, Runnable listener) { |
2 | if (source != null && listener != null) |
3 | bindToComponent(component, |
4 | r { |
5 | source.onChangeAndNow(listener); |
6 | }, |
7 | r { source.removeChangeListener(listener) }); |
8 | ret component; |
9 | } |
Began life as a copy of #1016236
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034435 |
Snippet name: | bindListenerToComponent |
Eternal ID of this version: | #1034435/1 |
Text MD5: | eb3aacf31d33eaacf8be721e7a686cde |
Transpilation MD5: | 79f34bb92f5502ad1af491bf8927d3ba |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-07 20:14:48 |
Source code size: | 329 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 180 / 247 |
Referenced in: | [show references] |