I want to assign `esc`key to close the application. I have while(! Display.isCloseRequested())
which I want to end.
So create a boolean variable, "remainOpen" or whatever, initialized to true. Test this variable in your while loop. Then, in the game loop, check for the escape key being pressed (this link describes how to test for key presses: http://lwjgl.org/wiki/index.php?title=LWJGL_Basics_2_(Input)#The_Event_Buffer (http://lwjgl.org/wiki/index.php?title=LWJGL_Basics_2_(Input)#The_Event_Buffer)) and if it is, set the remainOpen variable to false. Then at the end of the current iteration the loop will end.