Dialog的Esc退出

KeyStroke stroke = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); dialog.getRootPane().registerKeyboardAction(new ActionListener() {     public void actionPerformed(ActionEvent e) {         //dosomething     } }, stroke, JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT); 

 

你可能感兴趣的:(dialog)