Last active
December 11, 2015 12:29
-
-
Save ZachMassia/4601240 to your computer and use it in GitHub Desktop.
Move bot with up arrow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mainPanel.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("UP"), "moveUp"); | |
| mainPanel.getActionMap().put("moveUp", new AbstractAction() { | |
| @Override | |
| public void actionPerformed(ActionEvent e) { | |
| javax.swing.SwingUtilities.invokeLater(new Runnable() { | |
| @Override | |
| public void run() { | |
| bot.moveUp(); | |
| } | |
| }); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment