Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

8
LINES

< > BotCompany Repo | #1006687 // registerLeftKey - register cursor-left key for a whole JFrame

JavaX fragment (include)

static void registerLeftKey(JFrame frame, O r) {
  S name = "Left";
  Action action = abstractAction(name, r);
  JComponent pnl = frame.getRootPane();
  KeyStroke keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0);
  pnl.getActionMap().put(name, action);
  pnl.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(keyStroke, name);
}

Author comment

Began life as a copy of #1003691

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006687
Snippet name: registerLeftKey - register cursor-left key for a whole JFrame
Eternal ID of this version: #1006687/1
Text MD5: d199615fae16e62e767fe2c3fc8775af
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-31 06:05:12
Source code size: 343 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 432 / 477
Referenced in: [show references]