Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Hani Ibrahim
Added: Nov 9, 2018 9:52 AM
Views: 21
  1. // KeyListener
  2. this.addKeyListener(new KeyListener() {
  3.         @Override
  4.      public void keyPressed(KeyEvent e) {
  5.         if (e.getKeyCode() == KeyEvent.VK_F1) {
  6.                         // Enter code here
  7.           }
  8.      }
  9.      @Override
  10.      public void keyReleased(KeyEvent e) {
  11.      }
  12.      @Override
  13.      public void keyTyped(KeyEvent e) {
  14.      }
  15. });
  16.