コード例 #1
0
 public void keyReleased(KeyEvent E) {
   if (E.getKeyCode() == E.VK_ENTER) {
     if (E.getSource() == yes) {
       dispose();
       server.shutdown();
       return;
     } else if (E.getSource() == cancel) {
       dispose();
       return;
     }
   }
 }
コード例 #2
0
  public void keyReleased(KeyEvent E) {
    if (E.getKeyCode() == E.VK_ENTER) {
      if (E.getSource() == dismissButton) {
        dispose();
        return;
      }
    }

    if (E.getKeyCode() == E.VK_TAB) {
      if (E.getSource() == textArea) {
        // Tab out of the text area
        textArea.transferFocus();
        return;
      }
    }
  }