Transpiled version (9388L) is out of date.
1 | static JCheckBoxMenuItem jMenuItemStayCheckedOnClick(S text, IF0<Bool> checked, Runnable action) {
|
2 | var mi = swing(-> new JCheckBoxMenuItem(text, isTrue(checked!))); |
3 | |
4 | bindToComponent(mi, r {
|
5 | bool b = isTrue(checked!); |
6 | setChecked(mi, b); |
7 | }); |
8 | |
9 | addActionListener(mi, -> {
|
10 | if (!isChecked(mi)) setChecked(mi, true); |
11 | callF(action); |
12 | }); |
13 | |
14 | ret mi; |
15 | } |
Began life as a copy of #1035497
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035498 |
| Snippet name: | jMenuItemStayCheckedOnClick |
| Eternal ID of this version: | #1035498/3 |
| Text MD5: | 6f3c47cccaa84692f06abbf3c76bb8c6 |
| Author: | stefan |
| Category: | javax / gui |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-05-30 16:12:20 |
| Source code size: | 387 bytes / 15 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 363 / 470 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |