Well before I tried adding "addKeyListener(this)" to area where we create the frame. When i added "mainFrame.addKeyListener(this)" to the part I initialized other objects which is also after the creation of the mainFrame, my key listener started working.
Also i was wondering:
When i tried the keyboard input from the wiki, my vk_arrow keys do not work? Left, Right, Down, Up generate the same key instance and i'm not sure why. VK_ESCAPE works perfectly, but its these virtual arrow keys that make my program annoying. Sigh..