added JFrame and key press event handling