/**
* FIXME: These two addEscapeListener can be called on a new interface that implements RootPainCOntainer (Swing) and a new method that is called
* @param dialog
*/
public static void addEscapeListener(final EscapeListener dialog){
ActionListener escListener=new ActionListener(){
@Override public void actionPerformed( ActionEvent e){
dialog.escapePressed();
}
}
;
dialog.getRootPane().registerKeyboardAction(escListener,KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),JComponent.WHEN_IN_FOCUSED_WINDOW);
}

Example 13

From project bndtools, under directory /bndtools.bndplugins/src/bndtools/bndplugins/repo/git/.