java Window class does not dispatch key events?
I have extended the class Window to create the MetroWindow class, which is like the normal Window except that it is looks nicer.
When I add a TextField to it, I hear beep beep when I hit my keyboard and no letters are shown in the TextField. If, instead of extending Window, I extend JFrame, the TextField are able to receive keystrokes correctly.
I want to keep extending Window for my UI, 开发者_JS百科but I would like to receive the correct keystrokes on my TextField. How do I do this - dispatch keystroke, create listeners... ?
Sorry for providing an answer to my own question, but In case someone is looking for a solution...
What I did was to extend JFrame instead of Window.
I then set JFrame.setUndecorated(true);
this hides the toolbar which is what I was looking for.
精彩评论