Is there any way to find out the key pressed events in Java?? I am not talking about awt classes, i want to use them in my stand alone program. Specifically i want to catch the event of pressing Ctrl+C ( which is used to stop the program ) and execute some manipulations before actually shutting down my program. Any help in this regard is highly appreciated. This feature is actually implemented in J2EE server. When u try to stop the j2ee ( by pressing the ctrl+c key ), it actually catches the key and shuts it down properly.