title: Create a keyboard shortcut for a button
body: <p>I have a <code>JTable</code> that has a delete button to delete its rows.</p>
  
  <p>I want to create a shortcut, for example when user selects a row and presses the 'Delete' button on keyboard , that line should be deleted.</p>
  
  <p>My line is deleted with my <code>JButton1</code> perfectly.</p>
  
  <pre><code>        if (e.getSource() == KeyEvent.VK_DELETE) {
  
             // Delete row Method
      }
  </code></pre>
  
  <p>But it doesn't work.</p>