Libraryless. Click here for Pure Java version (9337L/52K).
1 | static JCheckBoxMenuItem jAlwaysCheckedMenuItem(S text, Runnable action) {
|
2 | var mi = swing(-> new JCheckBoxMenuItem(text, true)); |
3 | addActionListener(mi, -> {
|
4 | if (!isChecked(mi)) setChecked(mi, true); |
5 | callF(action); |
6 | }); |
7 | ret mi; |
8 | } |
Began life as a copy of #1006523
download show line numbers debug dex old transpilations
Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1035497 |
| Snippet name: | jAlwaysCheckedMenuItem |
| Eternal ID of this version: | #1035497/3 |
| Text MD5: | 952df0f42f0c6e336670b416c91505f5 |
| Transpilation MD5: | d07e2baffaa004a4f14a4775a1d4df7c |
| 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:03:32 |
| Source code size: | 249 bytes / 8 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 303 / 398 |
| Version history: | 2 change(s) |
| Referenced in: | [show references] |