Here you can find the source of getEscapeKeystroke()
public static KeyStroke getEscapeKeystroke()
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may import java.awt.event.KeyEvent; import javax.swing.*; public class Main { public static KeyStroke getEscapeKeystroke() { return KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0); }/*from w w w .ja va 2s . c o m*/ }