1 | static <A extends JComponent> A onKeyTyped(final int keyCode, final Runnable r, final A a) { |
2 | if (a != null) swing { |
3 | a.addKeyListener(new KeyAdapter { |
4 | @Override |
5 | public void keyTyped(KeyEvent e) { |
6 | if (e.getKeyCode() == keyCode && e.getModifiers() == 0) |
7 | pcallF(r); |
8 | } |
9 | }); |
10 | }); |
11 | ret a; |
12 | } |
download show line numbers debug dex old transpilations
Travelled to 12 computer(s): bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1019018 |
Snippet name: | onKeyTyped - might not work, keycode = 0? |
Eternal ID of this version: | #1019018/6 |
Text MD5: | 6bac6492dc1ef2299ce648d0de6e1996 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-10-21 12:55:37 |
Source code size: | 341 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 312 / 344 |
Version history: | 5 change(s) |
Referenced in: | [show references] |