title: jdialog enter and escape not working
body: <p>Context: I'm trying to create modal JDialog and pretty much replicate JOptionPane functionality with custom buttons with one condition - i don't want to use UIManager to set windows style.</p>
  
  <p>Problem: JDialog doesn't answer to ESCAPE and ENTER keys like it's supposed to. I've tried all proposed solutions i could find online (multiple listeners solutions, setting default button etc.) and i can't get it to work.</p>
  
  <p>Whole class is uploaded to pastebin at <a href="http://pastebin.com/Kcj82h2i" rel="nofollow">http://pastebin.com/Kcj82h2i</a></p>
  
  <p>Actual key settings in extended JDialog class are done with</p>
  
  <pre><code>InputMap inputMap = getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
  ActionMap actionMap = getRootPane().getActionMap(); 
  
  inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "returnyes");
  actionMap.put("returnyes", new ResultYes());
  
  inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "returnno");
  actionMap.put("returnno", new ResultNo());
  </code></pre>
  
  <p>And the dialog gets called from JFrame with the following code:</p>
  
  <pre><code>if (results == 1)
  {
      InvoiceLinesTableModel tm = (InvoiceLinesTableModel) tbl_invoiceItems.getModel();
      InvoiceLinesTableRow row = tm.getRow(tbl_invoiceItems.getSelectedRow());
      tm.deleteRow(row);
      tm.fireTableDataChanged();
      StaticFunctions.updateTableRowHeights(tbl_invoiceItems);
  }
  </code></pre>
  
  <p>Help?</p>