title: How to use Escape Key as input (Java)
body: <p>I just want to know how to use the Escape Key as iput for a simple program to end a do while loop like this:</p>
  
  <pre><code>import java.util.*;
  public class Escape_Key{
  
  public static void main(String args[]){
  
      do{ System.out.println(" MENU ");
  
      }while();    //I WANT TO END THIS LOOP WHEN THE ESCAPE KEY IS PRESSED.
  
      }//main
  
    }//Escape_Key
  </code></pre>