Libraryless. Click here for Pure Java version (5496L/31K).
1 | static <A extends JComponent> A awtStepContinuously(A component, Steppable steppable) {
|
2 | if (steppable == null) ret component; |
3 | |
4 | new SingleThread thread; |
5 | new BoolVar visible; |
6 | var info = _threadInfo(); |
7 | Runnable theLoop = r {
|
8 | _threadInheritInfo(info); |
9 | while ping (visible! && steppable.step()) {}
|
10 | }; |
11 | |
12 | bindToComponent(component, |
13 | -> { visible.set(); thread.go(theLoop); },
|
14 | -> visible.clear()); |
15 | |
16 | ret component; |
17 | } |
Began life as a copy of #1034897
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1034900 |
| Snippet name: | awtStepContinuously |
| Eternal ID of this version: | #1034900/1 |
| Text MD5: | d5694d211bfdef13994ed45fa8ce0fd6 |
| Transpilation MD5: | 4d65b5809003e3decc76c5a6aeaa6e30 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-03-13 04:57:31 |
| Source code size: | 457 bytes / 17 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 387 / 486 |
| Referenced in: | [show references] |