1 | // key = 1 to 12 |
2 | static void registerFunctionKey(JFrame frame, int key, O r) { |
3 | S name = "F" + key; |
4 | Action action = abstractAction(name, r); |
5 | JComponent pnl = frame.getRootPane(); |
6 | KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_F1+key-1, 0); |
7 | pnl.getActionMap().put(name, action); |
8 | pnl.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keyStroke, name); |
9 | } |
Began life as a copy of #1003690
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1003691 |
Snippet name: | registerFunctionKey - register function key (F1...F12) for a whole JFrame |
Eternal ID of this version: | #1003691/1 |
Text MD5: | 6ce5365c3d4187a8a14c0eded7dea225 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-13 02:49:00 |
Source code size: | 381 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 760 / 744 |
Referenced in: | [show references] |